未验证 提交 74aeb55a 编写于 作者: E EricZeng 提交者: GitHub

Merge pull request #266 from Liu-XinYuan/responsecode-fix

In case of authentication failure, add a clear response code
...@@ -67,6 +67,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -67,6 +67,7 @@ public class LoginServiceImpl implements LoginService {
if (ValidateUtils.isNull(classRequestMappingValue)) { if (ValidateUtils.isNull(classRequestMappingValue)) {
LOGGER.error("class=LoginServiceImpl||method=checkLogin||msg=uri illegal||uri={}", request.getRequestURI()); LOGGER.error("class=LoginServiceImpl||method=checkLogin||msg=uri illegal||uri={}", request.getRequestURI());
singleSignOn.setRedirectToLoginPage(response); singleSignOn.setRedirectToLoginPage(response);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return false; return false;
} }
...@@ -83,6 +84,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -83,6 +84,7 @@ public class LoginServiceImpl implements LoginService {
if (ValidateUtils.isBlank(username)) { if (ValidateUtils.isBlank(username)) {
// 未登录, 则返回false, 同时重定向到登录页面 // 未登录, 则返回false, 同时重定向到登录页面
singleSignOn.setRedirectToLoginPage(response); singleSignOn.setRedirectToLoginPage(response);
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return false; return false;
} }
...@@ -113,4 +115,4 @@ public class LoginServiceImpl implements LoginService { ...@@ -113,4 +115,4 @@ public class LoginServiceImpl implements LoginService {
} }
return true; return true;
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册