Merge pull request #4499 from dataease/pr@dev@perf_token_cache

perf(登录): 及时删除废弃的token缓存
This commit is contained in:
fit2cloud-chenyw 2023-02-09 17:19:04 +08:00 committed by GitHub
commit eb985501b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,9 +71,11 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
}
// 当没有出现登录超时 且需要刷新token 则执行刷新token
if (JWTUtils.loginExpire(authorization)) {
TokenCacheUtils.remove(authorization);
throw new AuthenticationException(expireMessage);
}
if (JWTUtils.needRefresh(authorization)) {
TokenCacheUtils.remove(authorization);
authorization = refreshToken(request, response);
}
JWTToken token = new JWTToken(authorization);