From 4a8781f4d974abd567e481822827aba93fac3ccc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期日, 26 九月 2021 15:18:05 +0800 Subject: [PATCH] fix jwt过滤编写问题 --- ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 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 c5161c5..aea860c 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 @@ throws ServletException, IOException { // 鍖垮悕璺緞鏀捐 榛樿鎷︽埅 - boolean flag = false; + boolean flag = true; + PathMatcher pm = new AntPathMatcher(); 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); -- Gitblit v1.9.3