Commit 6ef9a7bc authored by “yiyousong”'s avatar “yiyousong”
parents 4a1e436f bf7570b7
...@@ -50,7 +50,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -50,7 +50,7 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
@Value("${token.prefix:}") @Value("${token.prefix:}")
private String tokenPrefix; private String tokenPrefix;
protected static final Long MILLIS_SECOND = 1000l; protected static final Long MILLIS_SECOND = 1l;
protected static final Long MILLIS_MINUTE = 60 * MILLIS_SECOND; protected static final Long MILLIS_MINUTE = 60 * MILLIS_SECOND;
...@@ -238,10 +238,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -238,10 +238,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
// String token = IdUtil.fastSimpleUUID(); // String token = IdUtil.fastSimpleUUID();
// user.setToken(token); // user.setToken(token);
//todo 删除当前用户之前的令牌 //todo 删除当前用户之前的令牌
Set<String> keys = cacheService.scan(SysConstains.LOGIN_TOKEN_KEY + user.getId()); if (!user.isAdmin()) {
if (!ObjectUtils.isEmpty(keys)) { Set<String> keys = cacheService.scan(SysConstains.LOGIN_TOKEN_KEY + user.getId());
for (String key : keys) { if (!ObjectUtils.isEmpty(keys)) {
cacheService.del(key); for (String key : keys) {
cacheService.del(key);
}
} }
} }
refreshToken(user); refreshToken(user);
......
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