From a9fe595823ae5b2641ea55feafb8ef62040e4e65 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 20 Jul 2024 22:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E5=85=A8=E5=B1=80=EF=BC=9ALoginUser=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=EF=BC=8C=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E5=88=A4=E6=96=AD=20token=20=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/filter/security/TokenAuthenticationFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-gateway/src/main/java/cn/iocoder/yudao/gateway/filter/security/TokenAuthenticationFilter.java b/yudao-gateway/src/main/java/cn/iocoder/yudao/gateway/filter/security/TokenAuthenticationFilter.java index 656300768..e02a4bb62 100644 --- a/yudao-gateway/src/main/java/cn/iocoder/yudao/gateway/filter/security/TokenAuthenticationFilter.java +++ b/yudao-gateway/src/main/java/cn/iocoder/yudao/gateway/filter/security/TokenAuthenticationFilter.java @@ -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); }