|
|
|
@@ -27,6 +27,8 @@ import java.util.concurrent.TimeUnit; |
|
|
|
public class WxCUserServiceImpl implements WxCUserService { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
private String tokenPrev = "weapp:token:"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCUserMapper wxCUserMapper; |
|
|
|
|
|
|
|
@@ -66,7 +68,7 @@ public class WxCUserServiceImpl implements WxCUserService { |
|
|
|
@Override |
|
|
|
public WxCUser getByToken(String token) { |
|
|
|
logger.info("获取用户信息start ..."); |
|
|
|
String key = "token_" + token; |
|
|
|
String key = tokenPrev + token; |
|
|
|
ValueOperations<String, WxCUser> operations = cUserTokenRedisTemplate.opsForValue(); |
|
|
|
|
|
|
|
// 缓存 |
|
|
|
@@ -99,7 +101,7 @@ public class WxCUserServiceImpl implements WxCUserService { |
|
|
|
user.setUpdateDate(curr); |
|
|
|
ret = wxCUserMapper.updateByPrimaryKeySelective(user); |
|
|
|
} |
|
|
|
String key = "token_" + user.getToken(); |
|
|
|
String key = tokenPrev + user.getToken(); |
|
|
|
// 缓存已存在,删除 |
|
|
|
boolean hasKey = cUserTokenRedisTemplate.hasKey(key); |
|
|
|
if(hasKey) { |
|
|
|
|