mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
修复redis的string问题
This commit is contained in:
@@ -216,12 +216,12 @@ public class RedisUtils {
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
public static String get(String key) {
|
||||
private static String get(String key) {
|
||||
return key == null ? null : stringRedisTemplate.opsForValue().get(key);
|
||||
}
|
||||
|
||||
public static String getStr(String key) {
|
||||
return stringRedisTemplate.opsForValue().get(key);
|
||||
return get(key,String.class);
|
||||
}
|
||||
|
||||
public static <T> T get(String key, Class<T> tClass) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class LoginServiceImpl implements LoginService {
|
||||
return false;
|
||||
}
|
||||
String key = RedisKey.getKey(RedisKey.USER_TOKEN_STRING, uid);
|
||||
String realToken = redisUtils.get(key);
|
||||
String realToken = redisUtils.getStr(key);
|
||||
return token.equals(realToken);//有可能token失效了,需要校验是不是和最新token一致
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user