From bac43714a2bd71de6815f5fbbbd3812072bd6443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 21 Jul 2026 01:19:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E4=BF=AE=E5=A4=8D=E7=A7=9F?= =?UTF-8?q?=E6=88=B7ID=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B3=A8=E9=87=8A=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化异常处理,改为忽略异常并使用默认逻辑 - 增加最后从登录用户获取租户ID的尝试逻辑 - 统一未获取到租户ID时返回null而非undefined - 调整注释格式,使其更规范美观 - 注释掉部分表名,保持代码清晰 --- .../com/gxwebsoft/common/core/config/MybatisPlusConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java index b3655bc..a49bf58 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java @@ -67,13 +67,13 @@ public class MybatisPlusConfig { // 忽略异常,使用默认逻辑 System.err.println("获取租户ID异常: " + e.getMessage()); } - + // 最后尝试从登录用户获取 Expression loginUserTenantId = getLoginUserTenantId(); if (loginUserTenantId instanceof LongValue) { return loginUserTenantId; } - + // 如果都获取不到,返回null而不是undefined return new NullValue(); } @@ -92,6 +92,7 @@ public class MybatisPlusConfig { "sys_dictionary_data", "apps_test_data", "cms_lang" +// "cms_model" // "hjm_car", // "hjm_fence" // "cms_website"