fix:【framework 框架】TenantSecurityWebFilter 支持 context-path 校验无需租户 URL

https://github.com/YunaiV/ruoyi-vue-pro/issues/905
This commit is contained in:
YunaiV 2025-08-21 09:17:08 +08:00
parent e91fc70f87
commit e83834079e

View File

@ -101,13 +101,14 @@ public class TenantSecurityWebFilter extends ApiRequestFilter {
}
private boolean isIgnoreUrl(HttpServletRequest request) {
String apiUri = request.getRequestURI().substring(request.getContextPath().length());
// 快速匹配保证性能
if (CollUtil.contains(tenantProperties.getIgnoreUrls(), request.getRequestURI())) {
if (CollUtil.contains(tenantProperties.getIgnoreUrls(), apiUri)) {
return true;
}
// 逐个 Ant 路径匹配
for (String url : tenantProperties.getIgnoreUrls()) {
if (pathMatcher.match(url, request.getRequestURI())) {
if (pathMatcher.match(url, apiUri)) {
return true;
}
}