diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index fd4eb8c4073c63d213705db8014eaacb66ba3727..b0d1bdedac876acf9bdfce03e7edca43a9caf427 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); }; /** 租户列表 */