请求中附带非法或过期 Token 时,返回重复的 401 请求 #9107

This commit is contained in:
JEECG
2025-11-17 11:02:43 +08:00
parent 0be7d00eb2
commit 899264250c

View File

@ -110,8 +110,8 @@ public class ShiroRealm extends AuthorizingRealm {
loginUser = this.checkUserTokenIsEffect(token);
} catch (AuthenticationException e) {
log.error("—————校验 check token 失败——————————"+ e.getMessage(), e);
JwtUtil.responseError(SpringContextUtils.getHttpServletResponse(),401,e.getMessage());
return null;
// 重新抛出异常让JwtFilter统一处理避免返回两次错误响应
throw e;
}
return new SimpleAuthenticationInfo(loginUser, token, getName());
}