From bff9d0560d9c833c885f88f8ff0ab27aec8ef069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 26 Sep 2021 15:17:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20jwt=E8=BF=87=E6=BB=A4=E7=BC=96=E5=86=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/filter/JwtAuthenticationTokenFilter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java index c5161c534..2b53e8372 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java @@ -39,14 +39,13 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter throws ServletException, IOException { // 匿名路径放行 默认拦截 - boolean flag = false; + boolean flag = true; for (String anonymou : securityProperties.getAnonymous()) { PathMatcher pm = new AntPathMatcher(); - if (pm.matchStart(anonymou, request.getRequestURI())) { - flag = true; + if (pm.match(anonymou, request.getRequestURI())) { + flag = false; break; } - } if (flag) { LoginUser loginUser = tokenService.getLoginUser(request);