mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
🐛 修复忽略租户的 URL,未带租户会报错的问题
This commit is contained in:
parent
6471c8d586
commit
9b687ff6c9
@ -75,7 +75,7 @@ public class TenantSecurityWebFilter extends ApiRequestFilter {
|
||||
}
|
||||
}
|
||||
|
||||
//检查是否是忽略的 URL, 如果是则允许访问
|
||||
// 如果非允许忽略租户的 URL,则校验租户是否合法
|
||||
if (!isIgnoreUrl(request)) {
|
||||
// 2. 如果请求未带租户的编号,不允许访问。
|
||||
if (tenantId == null) {
|
||||
@ -92,6 +92,10 @@ public class TenantSecurityWebFilter extends ApiRequestFilter {
|
||||
ServletUtils.writeJSON(response, result);
|
||||
return;
|
||||
}
|
||||
} else { // 如果是允许忽略租户的 URL,若未传递租户编号,则默认忽略租户编号,避免报错
|
||||
if (tenantId == null) {
|
||||
TenantContextHolder.setIgnore(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 继续过滤
|
||||
|
@ -1,3 +1,6 @@
|
||||
### 获取租户编号 /admin-api/system/get-id-by-name
|
||||
GET {{baseUrl}}/system/tenant/get-id-by-name?name=芋道源码
|
||||
|
||||
### 创建租户 /admin-api/system/tenant/create
|
||||
POST {{baseUrl}}/system/tenant/create
|
||||
Content-Type: application/json
|
||||
|
Loading…
Reference in New Issue
Block a user