From 62da7e41beea60fea96bf4f4c9dbcbe3005fcd6e Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Sun, 18 May 2025 20:10:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=88=87=E6=8D=A2=E5=B9=B6=E6=B8=85=E9=99=A4?= =?UTF-8?q?tab=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/custom/tenant-select.vue | 5 +++-- src/layouts/modules/global-header/index.vue | 7 +------ src/store/modules/tab/index.ts | 12 +++++++++++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/custom/tenant-select.vue b/src/components/custom/tenant-select.vue index 2c86c4e1..de901880 100644 --- a/src/components/custom/tenant-select.vue +++ b/src/components/custom/tenant-select.vue @@ -3,7 +3,7 @@ import { computed, onMounted, ref } from 'vue'; import type { SelectOption } from 'naive-ui'; import { useLoading } from '@sa/hooks'; import { fetchTenantList } from '@/service/api'; -import { fetchClearTenant } from '@/service/api/system/tenant'; +import { fetchChangeTenant, fetchClearTenant } from '@/service/api/system/tenant'; import { useAppStore } from '@/store/modules/app'; import { useTabStore } from '@/store/modules/tab'; import { useAuthStore } from '@/store/modules/auth'; @@ -45,7 +45,7 @@ const showTenantSelect = computed(() => { async function closeAndRefresh(msg: string, val: CommonType.IdType = '') { lastSelected.value = val; window.$message?.success(msg); - clearTabs(); + clearTabs([], true); toHome(); appStore.reloadPage(500); } @@ -57,6 +57,7 @@ async function handleChangeTenant(_tenantId: CommonType.IdType) { if (lastSelected.value === _tenantId) { return; } + await fetchChangeTenant(_tenantId); closeAndRefresh('切换租户成功', _tenantId); } diff --git a/src/layouts/modules/global-header/index.vue b/src/layouts/modules/global-header/index.vue index 71156300..93c15ee2 100644 --- a/src/layouts/modules/global-header/index.vue +++ b/src/layouts/modules/global-header/index.vue @@ -1,8 +1,7 @@