|
|
@ -6,7 +6,7 @@ import { formatMenus, toTreeData, formatTreeData } from 'ele-admin-pro/es'; |
|
|
|
import type { MenuItemType } from 'ele-admin-pro/es'; |
|
|
|
import type { User } from '@/api/system/user/model'; |
|
|
|
import { TOKEN_STORE_NAME, USER_MENUS } from '@/config/setting'; |
|
|
|
import {getTenantInfo, getUserInfo} from '@/api/layout'; |
|
|
|
import {getUserInfo} from '@/api/layout'; |
|
|
|
import { initialization } from '@/api/layout'; |
|
|
|
import {clone} from "@/api/system/menu"; |
|
|
|
import { message } from 'ant-design-vue/es'; |
|
|
@ -40,9 +40,9 @@ export const useUserStore = defineStore({ |
|
|
|
* 请求用户信息、权限、角色、菜单 |
|
|
|
*/ |
|
|
|
async fetchUserInfo() { |
|
|
|
const company = await getTenantInfo().catch(() => void 0); |
|
|
|
// const company = await getTenantInfo().catch(() => void 0);
|
|
|
|
const result = await getUserInfo().catch(() => {}); |
|
|
|
if (!result || !company) { |
|
|
|
if (!result) { |
|
|
|
Modal.info({ |
|
|
|
title: '系统提示', |
|
|
|
content: '该应用已欠费,请先续费后访问!', |
|
|
@ -67,7 +67,7 @@ export const useUserStore = defineStore({ |
|
|
|
}); |
|
|
|
} |
|
|
|
// 克隆默认的云企业官网
|
|
|
|
if(company?.planId == 0){ |
|
|
|
if(result?.planId == 0){ |
|
|
|
const hide = message.loading('正在分配资源请勿刷新页面...', 0); |
|
|
|
await clone({companyId: 10431,tenantId: 10398}).then(() => { |
|
|
|
hide(); |
|
|
@ -93,7 +93,7 @@ export const useUserStore = defineStore({ |
|
|
|
} |
|
|
|
// 用户权限
|
|
|
|
this.authorities = |
|
|
|
company.authorities |
|
|
|
result.authorities |
|
|
|
?.filter((d) => !!d.authority) |
|
|
|
?.map((d) => d.authority) ?? []; |
|
|
|
// 用户角色
|
|
|
@ -104,7 +104,7 @@ export const useUserStore = defineStore({ |
|
|
|
const { menus, homePath } = formatMenus( |
|
|
|
USER_MENUS ?? |
|
|
|
toTreeData({ |
|
|
|
data: company.authorities |
|
|
|
data: result.authorities |
|
|
|
?.filter((d) => d.menuType !== 1) |
|
|
|
.map((d) => { |
|
|
|
// 改造子模块的访问路径
|
|
|
|