mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	解决登录时输入无效租户名称登录失败提示不友好问题
This commit is contained in:
		@@ -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. 校验租户是合法,例如说被禁用、到期
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user