Merge branch 'qianpw' into wuxichen

This commit is contained in:
2025-10-17 17:48:26 +08:00
14 changed files with 1737 additions and 59 deletions

View File

@@ -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;