Skip to content

Commit

Permalink
修改redis缓存token时间类型为秒
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoule committed May 2, 2018
1 parent 7b9bd38 commit f63b3d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public T set(String key, T value) {
public T set(String key, T value, long timeout) {
logger.debug("set key [{}]", key);
try {
redisTemplate.opsForValue().set(key, value, timeout, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(key, value, timeout, TimeUnit.SECONDS);
return value;
}
catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RedisTokenManager extends TokenManager {

@Override
public void addToken(String token, LoginUser loginUser) {
redisCache.set(token, loginUser, tokenTimeout * 1000);
redisCache.set(token, loginUser, tokenTimeout);
}

@Override
Expand Down

0 comments on commit f63b3d5

Please sign in to comment.