|
|
@@ -105,7 +105,8 @@ public class LoginService {
|
|
|
}
|
|
|
|
|
|
public void logout(String token) {
|
|
|
- String redisKey = String.format(RedisKey.TOKEN_V3,token);
|
|
|
+ String username = JwtUtil.getUsername(token);
|
|
|
+ String redisKey = String.format(RedisKeyUtil.LOGIN_USER ,username, token );
|
|
|
if(redisUtil.hasKey(redisKey)){
|
|
|
redisUtil.del(redisKey);
|
|
|
}
|
|
|
@@ -298,13 +299,14 @@ public class LoginService {
|
|
|
|
|
|
public String redisLogin(String userName,String value,String loginType){
|
|
|
String token = JwtUtil.createJWT(-1,userName,loginType);
|
|
|
- String redisKey = String.format(RedisKey.TOKEN_V3,token);
|
|
|
+ String redisKey = String.format(RedisKeyUtil.LOGIN_USER ,userName, token );
|
|
|
redisUtil.set(redisKey, value,2 * 60 * 60);
|
|
|
return token;
|
|
|
}
|
|
|
|
|
|
public void loginCheck(String token) {
|
|
|
- String redisKey = String.format(RedisKey.TOKEN_V3,token);
|
|
|
+ String username = JwtUtil.getUsername(token);
|
|
|
+ String redisKey = String.format(RedisKeyUtil.LOGIN_USER ,username, token );
|
|
|
if(!redisUtil.hasKey(redisKey)){
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3004, LoginConstant.FAILURE_MSG_3004);
|
|
|
}
|