Merge branch 'qianpw' into wuxichen
This commit is contained in:
@@ -16,8 +16,8 @@ import type { UserInfoVO } from '@/services/login/types';
|
||||
import defaultSettings from '../config/defaultSettings';
|
||||
import { errorConfig } from './requestErrorConfig';
|
||||
import '@ant-design/v5-patch-for-react-19';
|
||||
import { useDictStore } from '@/hooks/stores/dict';
|
||||
import { getAccessToken, getTenantId } from '@/utils/auth';
|
||||
|
||||
import { CACHE_KEY, useCache } from './hooks/web/useCache';
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
@@ -36,6 +36,7 @@ export async function getInitialState(): Promise<{
|
||||
fetchUserInfo?: () => Promise<UserInfoVO | undefined>;
|
||||
}> {
|
||||
const { wsCache } = useCache();
|
||||
const dictStore = useDictStore();
|
||||
const fetchUserInfo = async () => {
|
||||
// history.push(loginPath);
|
||||
try {
|
||||
@@ -47,6 +48,10 @@ export async function getInitialState(): Promise<{
|
||||
wsCache.set(CACHE_KEY.USER, data);
|
||||
wsCache.set(CACHE_KEY.ROLE_ROUTERS, data.menus);
|
||||
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap();
|
||||
}
|
||||
|
||||
// 转换菜单格式
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user