token续期修改
This commit is contained in:
@@ -44,6 +44,7 @@ import java.util.Objects;
|
|||||||
public class TokenFilter extends GenericFilterBean {
|
public class TokenFilter extends GenericFilterBean {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TokenFilter.class);
|
private static final Logger log = LoggerFactory.getLogger(TokenFilter.class);
|
||||||
|
|
||||||
|
|
||||||
private final TokenProvider tokenProvider;
|
private final TokenProvider tokenProvider;
|
||||||
private final SecurityProperties properties;
|
private final SecurityProperties properties;
|
||||||
private final OnlineUserService onlineUserService;
|
private final OnlineUserService onlineUserService;
|
||||||
@@ -53,7 +54,7 @@ public class TokenFilter extends GenericFilterBean {
|
|||||||
* @param tokenProvider Token
|
* @param tokenProvider Token
|
||||||
* @param properties JWT
|
* @param properties JWT
|
||||||
* @param onlineUserService 用户在线
|
* @param onlineUserService 用户在线
|
||||||
* @param userCacheClean 用户缓存清理工具
|
* @param userCacheManager 用户缓存工具
|
||||||
*/
|
*/
|
||||||
public TokenFilter(TokenProvider tokenProvider, SecurityProperties properties, OnlineUserService onlineUserService, UserCacheClean userCacheClean) {
|
public TokenFilter(TokenProvider tokenProvider, SecurityProperties properties, OnlineUserService onlineUserService, UserCacheClean userCacheClean) {
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
@@ -81,8 +82,7 @@ public class TokenFilter extends GenericFilterBean {
|
|||||||
userCacheClean.cleanUserCache(String.valueOf(tokenProvider.getClaims(token).get(TokenProvider.AUTHORITIES_KEY)));
|
userCacheClean.cleanUserCache(String.valueOf(tokenProvider.getClaims(token).get(TokenProvider.AUTHORITIES_KEY)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (onlineUserDto != null && StringUtils.hasText(token)) {
|
if (onlineUserDto != null && StringUtils.hasText(token)) {
|
||||||
if ( StringUtils.hasText(token)) {
|
|
||||||
Authentication authentication = tokenProvider.getAuthentication(token);
|
Authentication authentication = tokenProvider.getAuthentication(token);
|
||||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
// Token 续期
|
// Token 续期
|
||||||
|
|||||||
Reference in New Issue
Block a user