修改401返回

This commit is contained in:
sh
2026-05-20 12:47:33 +08:00
parent f2f12d72a1
commit 587e98cfa8
2 changed files with 22 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, S
{
int code = HttpStatus.UNAUTHORIZED;
String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.unAuth(code, msg)));
ServletUtils.renderStringRaw(response, JSON.toJSONString(AjaxResult.unAuth(code, msg)));
// response.setStatus(HttpStatus.UNAUTHORIZED);
}
}