fix filter logic

This commit is contained in:
xiefangzhen 2025-01-03 10:40:19 +08:00
parent b1459824a6
commit 97e28f289b
2 changed files with 2 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

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