csi-financial-front/src/views/pages/index/index.vue

28 lines
771 B
Vue
Raw Normal View History

2026-03-23 15:21:53 +08:00
<template>
<!-- {{ roleName }} -->
<component :is="com[roleName]" />
</template>
<script setup lang="ts" name="dashboard">
import { ref, onMounted, defineAsyncComponent, computed, onUnmounted } from 'vue';
import { Session } from '/@/utils/storage';
import { NextLoading } from '/@/utils/loading';
// 引入组件
const com: any = {
common: defineAsyncComponent(() => import('/@/views/pages/index/common/index.vue')),
admin: defineAsyncComponent(() => import('/@/views/pages/index/admin/index.vue')),
};
// 获取账号类型
const roleName = computed(() => {
return Session.get('roleName') === 'common' || Session.get('roleName') === 'subCommon' ? 'common' : 'admin';
});
onMounted(() => {
NextLoading.done();
});
</script>
<style scoped lang="scss"></style>