From 1030237ea490f3ee46c7829cca041817dc8d674e Mon Sep 17 00:00:00 2001 From: xiehang12 <8296294+xiehang12@user.noreply.gitee.com> Date: Fri, 12 Jul 2024 16:18:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=BD=93=E5=89=8D=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8A=A8=E6=80=81=E5=88=87=E6=8D=A2=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=88=99=E9=9C=80=E8=A6=81=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?refreshPage=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E5=88=A9=E7=94=A8=E9=A6=96=E9=A1=B5=E5=81=9A?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E6=97=B6=E8=8E=B7=E5=8F=96=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index fd4eb8c4..b0d1bded 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -98,6 +98,7 @@ import { getTenantList } from '@/api/login'; import { dynamicClear, dynamicTenant } from '@/api/system/tenant'; import { TenantVO } from '@/api/types'; import notice from './notice/index.vue'; +import { RouteLocationNormalized } from 'vue-router'; const appStore = useAppStore(); const userStore = useUserStore(); @@ -120,7 +121,18 @@ const searchMenuRef = ref>(); const openSearchMenu = () => { searchMenuRef.value?.openSearch(); }; - +//首页标签页 +const homeTag: RouteLocationNormalized = { + hash: '', + matched: [], + params: undefined, + query: undefined, + redirectedFrom: undefined, + fullPath: '/index', + path: '/index', + name: 'Index', + meta: {} +}; // 动态切换 const dynamicTenantEvent = async (tenantId: string) => { if (companyName.value != null && companyName.value !== '') { @@ -128,6 +140,8 @@ const dynamicTenantEvent = async (tenantId: string) => { dynamic.value = true; proxy?.$tab.closeAllPage(); proxy?.$router.push('/'); + //刷新首页 + proxy?.$tab.refreshPage(homeTag); } }; @@ -136,6 +150,8 @@ const dynamicClearEvent = async () => { dynamic.value = false; proxy?.$tab.closeAllPage(); proxy?.$router.push('/'); + //刷新首页 + proxy?.$tab.refreshPage(homeTag); }; /** 租户列表 */ -- Gitee