mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
请求中附带非法或过期 Token 时,返回重复的 401 请求 #9107
This commit is contained in:
@ -110,8 +110,8 @@ public class ShiroRealm extends AuthorizingRealm {
|
|||||||
loginUser = this.checkUserTokenIsEffect(token);
|
loginUser = this.checkUserTokenIsEffect(token);
|
||||||
} catch (AuthenticationException e) {
|
} catch (AuthenticationException e) {
|
||||||
log.error("—————校验 check token 失败——————————"+ e.getMessage(), e);
|
log.error("—————校验 check token 失败——————————"+ e.getMessage(), e);
|
||||||
JwtUtil.responseError(SpringContextUtils.getHttpServletResponse(),401,e.getMessage());
|
// 重新抛出异常,让JwtFilter统一处理,避免返回两次错误响应
|
||||||
return null;
|
throw e;
|
||||||
}
|
}
|
||||||
return new SimpleAuthenticationInfo(loginUser, token, getName());
|
return new SimpleAuthenticationInfo(loginUser, token, getName());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user