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);