From 37fcc5cbe7b749c213a0c1a7981db319fb0138bf Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Wed, 29 Mar 2023 21:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=97=A0=E6=95=88=E7=A7=9F=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=99=BB=E5=BD=95=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=8F=8B=E5=A5=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenant/core/security/TenantSecurityWebFilter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java index efb808475..74e449387 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java @@ -78,8 +78,12 @@ public class TenantSecurityWebFilter extends ApiRequestFilter { // 2. 如果请求未带租户的编号,不允许访问。 if (tenantId == null) { log.error("[doFilterInternal][URL({}/{}) 未传递租户编号]", request.getRequestURI(), request.getMethod()); - ServletUtils.writeJSON(response, CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(), - "租户的请求未传递,请进行排查")); + String msg = "请求的租户标识未传递,请进行排查"; + if ("/admin-api/system/auth/login".equals(request.getRequestURI())) + { + msg = "登录失败,租户名称不正确"; + } + ServletUtils.writeJSON(response, CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(), msg)); return; } // 3. 校验租户是合法,例如说被禁用、到期