Commit be0084ba authored by 赵啸非's avatar 赵啸非

修改redis认证方式

parent 885c8a4c
......@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -96,9 +97,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid);
//cacheService.select(portalDb);
cacheService.select(0);
String userStr = cacheService.get(userKey);
cacheService.select(db);
// cacheService.select(0);
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(0);
String userStr =redisTemplate.opsForValue().get(userKey);
// String userStr = cacheService.get(userKey);
// cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
//与本地转换
......
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