From 2c602033bdabbaafc75bcc37a40f809b61469881 Mon Sep 17 00:00:00 2001 From: MoChou <1373639299@qq.com> Date: Sun, 20 Jul 2025 22:43:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(tenant):=20=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=92=8Ctoken=E8=BF=87=E6=9C=9F=E6=97=B6=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E7=A7=9F=E6=88=B7ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/modules/tenant.ts | 7 ++++++- src/stores/modules/user.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stores/modules/tenant.ts b/src/stores/modules/tenant.ts index fc386e3..e9ba0ca 100644 --- a/src/stores/modules/tenant.ts +++ b/src/stores/modules/tenant.ts @@ -17,11 +17,15 @@ export const useTenantStore = defineStore('tenant', () => { return tenantEnabled.value && !tenantId.value }) - // 新增:判断租户是否已正确配置 + // 判断租户是否已正确配置 const isTenantConfigured = computed(() => { return tenantEnabled.value && !!tenantId.value }) + // 清空租户ID + const resetTenantId = () => { + tenantId.value = undefined + } return { tenantEnabled, tenantId, @@ -29,6 +33,7 @@ export const useTenantStore = defineStore('tenant', () => { setTenantId, needInputTenantCode, isTenantConfigured, + resetTenantId, } }, { persist: { paths: ['tenantEnabled', 'tenantId'], storage: localStorage }, diff --git a/src/stores/modules/user.ts b/src/stores/modules/user.ts index 1bb8b30..34e3b2c 100644 --- a/src/stores/modules/user.ts +++ b/src/stores/modules/user.ts @@ -89,6 +89,7 @@ const storeSetup = () => { pwdExpiredShow.value = true resetToken() resetRouter() + tenantStore.resetTenantId() } // 退出登录