!91 修复正常租户登陆后退出切换到过期租户时造成的tenant.ignore-urls配置失效的问题,比如无法获取验证码图片造成无法登录。

Merge pull request !91 from 清溪先生/master
This commit is contained in:
芋道源码 2022-03-09 10:27:15 +00:00 committed by Gitee
commit 3c3919545a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -75,16 +75,16 @@ public class TenantSecurityWebFilter extends ApiRequestFilter {
} }
} }
// 2. 如果请求未带租户的编号检查是否是忽略的 URL否则也不允许访问 //检查是否是忽略的 URL, 如果是则允许访问
if (tenantId == null && !isIgnoreUrl(request)) { if (!isIgnoreUrl(request)) {
log.error("[doFilterInternal][URL({}/{}) 未传递租户编号]", request.getRequestURI(), request.getMethod()); // 2. 如果请求未带租户的编号不允许访问
ServletUtils.writeJSON(response, CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(), if (tenantId == null) {
"租户的请求未传递,请进行排查")); log.error("[doFilterInternal][URL({}/{}) 未传递租户编号]", request.getRequestURI(), request.getMethod());
return; ServletUtils.writeJSON(response, CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),
} "租户的请求未传递,请进行排查"));
return;
// 3. 校验租户是合法例如说被禁用到期 }
if (tenantId != null) { // 3. 校验租户是合法例如说被禁用到期
try { try {
tenantFrameworkService.validTenant(tenantId); tenantFrameworkService.validTenant(tenantId);
} catch (Throwable ex) { } catch (Throwable ex) {