Commit 949fa225093bd4e9d0c9115b95dbb693411ef852

Authored by YunaiV
1 parent 19b5582a

添加项目前缀,日志无法插入 #731

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 { @@ -20,8 +20,8 @@ public abstract class ApiRequestFilter extends OncePerRequestFilter {
20 @Override 20 @Override
21 protected boolean shouldNotFilter(HttpServletRequest request) { 21 protected boolean shouldNotFilter(HttpServletRequest request) {
22 // 只过滤 API 请求的地址 22 // 只过滤 API 请求的地址
23 - return !StrUtil.startWithAny(request.getRequestURI(), webProperties.getAdminApi().getPrefix(),  
24 - webProperties.getAppApi().getPrefix()); 23 + String apiUri = request.getRequestURI().substring(request.getContextPath().length());
  24 + return !StrUtil.startWithAny(apiUri, webProperties.getAdminApi().getPrefix(), webProperties.getAppApi().getPrefix());
25 } 25 }
26 26
27 } 27 }