Commit 900cda8c authored by wzp's avatar wzp

修改bug

parent 1edac0ba
......@@ -46,11 +46,10 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
@Override
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
LOGGER.info("isAccessAllowed");
// if (isLoginAttempt(request, response)) {
if (isLoginAttempt(request, response)) {
//if (!isLoginAttempt(request, response) || !executeLogin(request,response)) {
try {
executeLogin(request, response);
return true;
} catch (UnauthorizedException e) {
// response403(request,response);
return false;
......@@ -58,8 +57,8 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
// response401(request, response);
return false;
}
// }
// return true;
}
return true;
}
/**
......
......@@ -184,7 +184,7 @@ public class GlobalExceptionAdvisor {
public Object handleUnauthorizedException(UnauthorizedException exception) {
cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult = new cn.wisenergy.chnmuseum.party.common.validator.HttpResult();
// 无权限
addResCodeToMap(RESPONSE_CODE_ENUM.UNAUTHORIZED, httpResult);
addResCodeToMap(RESPONSE_CODE_ENUM.ACCOUNT_AUTHENTICATION_FAILED, httpResult);
return httpResult;
}
......@@ -198,7 +198,7 @@ public class GlobalExceptionAdvisor {
public Object handleUnauthenticatedException(UnauthenticatedException exception) {
cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult = new cn.wisenergy.chnmuseum.party.common.validator.HttpResult();
// 无权限
addResCodeToMap(RESPONSE_CODE_ENUM.UNAUTHORIZED, httpResult);
addResCodeToMap(RESPONSE_CODE_ENUM.ACCOUNT_AUTHENTICATION_FAILED, httpResult);
return httpResult;
}
......
......@@ -93,6 +93,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/verifyCode1", "anon");
filterChainDefinitionMap.put("/loginByQrCode", "anon");
filterChainDefinitionMap.put("/doc.html", "anon");
filterChainDefinitionMap.put("/swagger-ui.html", "anon");
filterChainDefinitionMap.put("/404", "anon");
filterChainDefinitionMap.put("/500", "anon");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment