如果当前在首页,超级管理员动态切换租户后,则需要进行refreshPage刷新页面,方便利用首页做业务时获取正确租户数据。
This commit is contained in:
parent
817c65f7e2
commit
1030237ea4
@ -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<InstanceType<typeof SearchMenu>>();
|
||||
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);
|
||||
};
|
||||
|
||||
/** 租户列表 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user