From fdea0ae0ea04cfe8eb11bb329e8b02645cd87441 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Apr 2023 09:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=B7=E6=B1=82=E5=A4=B4?= =?UTF-8?q?=E7=9A=84=20tenant-id=20=E7=9A=84=E8=A7=A3=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E9=81=BF=E5=85=8D=E5=89=8D=E7=AB=AF=E4=BC=A0?= =?UTF-8?q?=E9=94=99=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/web/core/util/WebFrameworkUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java index 872e66423..3a2bea582 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/util/WebFrameworkUtils.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.framework.web.core.util; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -40,7 +41,7 @@ public class WebFrameworkUtils { */ public static Long getTenantId(HttpServletRequest request) { String tenantId = request.getHeader(HEADER_TENANT_ID); - return StrUtil.isNotEmpty(tenantId) ? Long.valueOf(tenantId) : null; + return NumberUtil.isNumber(tenantId) ? Long.valueOf(tenantId) : null; } public static void setLoginUserId(ServletRequest request, Long userId) {