From 949fa225093bd4e9d0c9115b95dbb693411ef852 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 9 Feb 2025 07:15:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=89=8D?= =?UTF-8?q?=E7=BC=80=EF=BC=8C=E6=97=A5=E5=BF=97=E6=97=A0=E6=B3=95=E6=8F=92?= =?UTF-8?q?=E5=85=A5=20#731?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/web/core/filter/ApiRequestFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/ApiRequestFilter.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/ApiRequestFilter.java index b702515590..7b064e8d6e 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/ApiRequestFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/ApiRequestFilter.java @@ -20,8 +20,8 @@ public abstract class ApiRequestFilter extends OncePerRequestFilter { @Override protected boolean shouldNotFilter(HttpServletRequest request) { // 只过滤 API 请求的地址 - return !StrUtil.startWithAny(request.getRequestURI(), webProperties.getAdminApi().getPrefix(), - webProperties.getAppApi().getPrefix()); + String apiUri = request.getRequestURI().substring(request.getContextPath().length()); + return !StrUtil.startWithAny(apiUri, webProperties.getAdminApi().getPrefix(), webProperties.getAppApi().getPrefix()); } }