Pre Merge pull request !587 from AprilWind/dev

This commit is contained in:
AprilWind 2024-09-13 05:52:56 +00:00 committed by Gitee
commit d4d25b85de
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -130,7 +130,7 @@ public class TenantHelper {
if (!isEnable()) { if (!isEnable()) {
return; return;
} }
if (!isLogin() || !global) { if (!StpUtil.isLogin() || !global) {
TEMP_DYNAMIC_TENANT.set(tenantId); TEMP_DYNAMIC_TENANT.set(tenantId);
return; return;
} }
@ -147,7 +147,7 @@ public class TenantHelper {
if (!isEnable()) { if (!isEnable()) {
return null; return null;
} }
if (!isLogin()) { if (!StpUtil.isLogin()) {
return TEMP_DYNAMIC_TENANT.get(); return TEMP_DYNAMIC_TENANT.get();
} }
// 如果线程内有值 优先返回 // 如果线程内有值 优先返回
@ -167,7 +167,7 @@ public class TenantHelper {
if (!isEnable()) { if (!isEnable()) {
return; return;
} }
if (!isLogin()) { if (!StpUtil.isLogin()) {
TEMP_DYNAMIC_TENANT.remove(); TEMP_DYNAMIC_TENANT.remove();
return; return;
} }
@ -218,13 +218,4 @@ public class TenantHelper {
return tenantId; return tenantId;
} }
private static boolean isLogin() {
try {
StpUtil.checkLogin();
return true;
} catch (Exception e) {
return false;
}
}
} }