fix: 获取用户信息
parent
36ffbbbb95
commit
6cd86eb9c3
|
@ -8,15 +8,16 @@ import { preferences } from '@vben/preferences';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { getAuthPermissionInfoApi } from '#/api';
|
|
||||||
import { BasicLayout, IFrameView } from '#/layouts';
|
import { BasicLayout, IFrameView } from '#/layouts';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
import { useAuthStore } from '#/store';
|
||||||
|
|
||||||
import { buildMenus } from './helper';
|
import { buildMenus } from './helper';
|
||||||
|
|
||||||
const forbiddenComponent = () => import('#/views/_core/fallback/forbidden.vue');
|
const forbiddenComponent = () => import('#/views/_core/fallback/forbidden.vue');
|
||||||
|
|
||||||
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||||
|
const authStore = useAuthStore();
|
||||||
const pageMap: ComponentRecordType = import.meta.glob('../views/**/*.vue');
|
const pageMap: ComponentRecordType = import.meta.glob('../views/**/*.vue');
|
||||||
|
|
||||||
const layoutMap: ComponentRecordType = {
|
const layoutMap: ComponentRecordType = {
|
||||||
|
@ -31,7 +32,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||||
content: `${$t('common.loadingMenu')}...`,
|
content: `${$t('common.loadingMenu')}...`,
|
||||||
duration: 1.5,
|
duration: 1.5,
|
||||||
});
|
});
|
||||||
const authPermissionInfo = await getAuthPermissionInfoApi();
|
const authPermissionInfo = await authStore.getAuthPermissionInfo();
|
||||||
const menus = authPermissionInfo.menus;
|
const menus = authPermissionInfo.menus;
|
||||||
const routes = buildMenus(menus);
|
const routes = buildMenus(menus);
|
||||||
const menuList = [...routes];
|
const menuList = [...routes];
|
||||||
|
|
Loading…
Reference in New Issue