diff --git a/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java b/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java index ae49b8b7e4..8de853909b 100644 --- a/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java +++ b/mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java @@ -46,7 +46,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo //白名单请求直接放行 PathMatcher pathMatcher = new AntPathMatcher(); for (String path : ignoreUrlsConfig.getUrls()) { - if(pathMatcher.match(path,request.getRequestURI())){ + if(pathMatcher.match(path,request.getRequestURI().substring(request.getContextPath().length()))){ fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); return; }