Commit 56820a34 authored by 赵啸非's avatar 赵啸非

修改接口访问异步消息保存

parent af356211
...@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -92,10 +93,13 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -92,10 +93,13 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token); Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY); String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
cacheService.select(portalDb); /* cacheService.select(portalDb);
String userStr = cacheService.get(userKey); String userStr = cacheService.get(userKey);
cacheService.select(db); cacheService.select(db);*/
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String userStr =redisTemplate.opsForValue().get(userKey);
if (StringUtils.isNotEmpty(userStr)) { if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class); UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token); userEntity.setToken(token);
......
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