解决 Set access token expire time to 0 报错问题
This commit is contained in:
parent
f59119bf6e
commit
3e350151bc
@ -37,7 +37,9 @@ public class OAuth2AccessTokenRedisDAO {
|
||||
// 清理多余字段,避免缓存
|
||||
accessTokenDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null);
|
||||
long time = LocalDateTimeUtil.between(LocalDateTime.now(), accessTokenDO.getExpiresTime(), ChronoUnit.SECONDS);
|
||||
stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS);
|
||||
if (time > 0) {
|
||||
stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(String accessToken) {
|
||||
|
Loading…
Reference in New Issue
Block a user