多租户自定义主页
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import Index from '@/views/index/tenantIndex.vue';
|
||||
import defalutIndex from '@/views/index/defaultIndex.vue';
|
||||
import Dash from '@/views/dashboard/overview/index.vue';
|
||||
import Gold from '@/views/perfManage/goldTarget/index.vue';
|
||||
import { getConfigKey } from '@/api/system/config';
|
||||
|
||||
import { defineAsyncComponent, onMounted, shallowRef } from 'vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
@@ -16,12 +12,24 @@ const currentComponent = shallowRef(
|
||||
|
||||
onMounted(() => {
|
||||
if (useUserStore().roles.includes('tenant')) {
|
||||
//租户
|
||||
currentComponent.value = Index;
|
||||
useLayoutStore().changeConf('layout', 'top');
|
||||
useLayoutStore().changeConf('menuTheme', 'light');
|
||||
useLayoutStore().changeConf('tabRender', false);
|
||||
} else {
|
||||
useLayoutStore().changeConf('layout', 'mix');
|
||||
//获取当前系统设置的首页路径
|
||||
getConfigKey('sys.homePage').then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
console.log(res.data);
|
||||
if (res.data) {
|
||||
currentComponent.value = defineAsyncComponent(
|
||||
() => import(`./${res.data}.vue`)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user