Commit 559207f1 authored by 赵啸非's avatar 赵啸非

修改认证获取redis方式

parent 32769620
......@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -106,14 +107,17 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid);
cacheService.select(portalDb);
String userStr = cacheService.get(userKey);
//cacheService.select(portalDb);
// String userStr = cacheService.get(userKey);
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String userStr =redisTemplate.opsForValue().get(userKey);
//刷新token时间
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
if (!ObjectUtils.isEmpty(userEntity)) {
verifyToken(userEntity);
}
cacheService.select(db);
// cacheService.select(db);
if (!ObjectUtils.isEmpty(userEntity)) {
UserEntity temp = userService.getExtCache(userEntity.getLoginName());
if (!ObjectUtils.isEmpty(temp)) {
......
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