Commit e83834079e874a9ff27cbdbc574c9d063e85b109
1 parent
e91fc70f
fix:【framework 框架】TenantSecurityWebFilter 支持 context-path 校验无需租户 URL
https://github.com/YunaiV/ruoyi-vue-pro/issues/905
Showing
1 changed file
with
3 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java
| ... | ... | @@ -101,13 +101,14 @@ public class TenantSecurityWebFilter extends ApiRequestFilter { |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | private boolean isIgnoreUrl(HttpServletRequest request) { |
| 104 | + String apiUri = request.getRequestURI().substring(request.getContextPath().length()); | |
| 104 | 105 | // 快速匹配,保证性能 |
| 105 | - if (CollUtil.contains(tenantProperties.getIgnoreUrls(), request.getRequestURI())) { | |
| 106 | + if (CollUtil.contains(tenantProperties.getIgnoreUrls(), apiUri)) { | |
| 106 | 107 | return true; |
| 107 | 108 | } |
| 108 | 109 | // 逐个 Ant 路径匹配 |
| 109 | 110 | for (String url : tenantProperties.getIgnoreUrls()) { |
| 110 | - if (pathMatcher.match(url, request.getRequestURI())) { | |
| 111 | + if (pathMatcher.match(url, apiUri)) { | |
| 111 | 112 | return true; |
| 112 | 113 | } |
| 113 | 114 | } | ... | ... |