Bläddra i källkod

fix filter logic

xiefangzhen 7 månader sedan
förälder
incheckning
97e28f289b

BIN
.DS_Store


+ 2 - 1
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/ApiRequestFilter.java

@@ -20,7 +20,8 @@ public abstract class ApiRequestFilter extends OncePerRequestFilter {
     @Override
     protected boolean shouldNotFilter(HttpServletRequest request) {
         // 只过滤 API 请求的地址
-        return !StrUtil.startWithAny(request.getRequestURI(), webProperties.getAdminApi().getPrefix(),
+        String contextPath = request.getContextPath();
+        return !StrUtil.startWithAny(request.getRequestURI().substring(contextPath.length()), webProperties.getAdminApi().getPrefix(),
                 webProperties.getAppApi().getPrefix());
     }