master
parent
29e015aa8b
commit
7550b3caaf
|
|
@ -22,5 +22,4 @@ public interface TokenService {
|
||||||
|
|
||||||
String getTokenByUserId(Long userId);
|
String getTokenByUserId(Long userId);
|
||||||
|
|
||||||
void addExpireTime(LoginUser loginUser);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,4 @@ public class TokenServiceImpl implements TokenService {
|
||||||
return idTokenRedisTemplate.opsForValue().get(getUserIdKey(userId));
|
return idTokenRedisTemplate.opsForValue().get(getUserIdKey(userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置token过期时间
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
@Override
|
|
||||||
public void addExpireTime(LoginUser loginUser) {
|
|
||||||
redisTemplate.expire(getTokenKey(loginUser.getToken()), expireSeconds, TimeUnit.SECONDS);
|
|
||||||
idTokenRedisTemplate.expire(getUserIdKey(loginUser.getId()), expireSeconds, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue