Commit 513d9063 authored by 赵啸非's avatar 赵啸非

修改登录踢人 排除管理员

parent 425ab64b
...@@ -238,12 +238,15 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -238,12 +238,15 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
// String token = IdUtil.fastSimpleUUID(); // String token = IdUtil.fastSimpleUUID();
// user.setToken(token); // user.setToken(token);
//todo 删除当前用户之前的令牌 //todo 删除当前用户之前的令牌
if (!user.isAdmin()) {
Set<String> keys = cacheService.scan(SysConstains.LOGIN_TOKEN_KEY + user.getId()); Set<String> keys = cacheService.scan(SysConstains.LOGIN_TOKEN_KEY + user.getId());
if (!ObjectUtils.isEmpty(keys)) { if (!ObjectUtils.isEmpty(keys)) {
for (String key : keys) { for (String key : keys) {
cacheService.del(key); cacheService.del(key);
} }
} }
}
refreshToken(user); refreshToken(user);
Map<String, Object> claims = new HashMap<>(); Map<String, Object> claims = new HashMap<>();
claims.put(SysConstains.LOGIN_USER_KEY, user.getToken()); claims.put(SysConstains.LOGIN_USER_KEY, user.getToken());
......
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