【功能优化】全局:LoginUser 新增过期时间,方便判断 token 过期

pull/126/MERGE
YunaiV 2024-07-20 22:36:30 +08:00
parent c7d5c68b3b
commit a9fe595823
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ public class TokenAuthenticationFilter implements GlobalFilter, Ordered {
return getLoginUser(exchange, token).defaultIfEmpty(LOGIN_USER_EMPTY).flatMap(user -> {
// 1. 无用户,直接 filter 继续请求
if (user == LOGIN_USER_EMPTY || // 下面 expiresTime 的判断,为了解决 token 实际已经过期的情况
user.getExpiresTime() == null || LocalDateTimeUtils.afterNow(user.getExpiresTime())) {
user.getExpiresTime() == null || LocalDateTimeUtils.beforeNow(user.getExpiresTime())) {
return chain.filter(exchange);
}