Merge pull request #731 from xiefangzhenz/bugfix/filter-logic-fix

添加项目前缀,日志无法插入
This commit is contained in:
芋道源码
2025-02-09 07:16:09 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -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());
}
}