|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Settings as LayoutSettings, PageLoading } from '@ant-design/pro-layout';
|
|
|
+import { Settings as LayoutSettings, PageLoading,BasicLayoutProps } from '@ant-design/pro-layout';
|
|
|
import {message, notification} from 'antd';
|
|
|
import qs from 'qs';
|
|
|
import { history, RequestConfig, RunTimeLayoutConfig, ErrorShowType } from 'umi';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
selectNavList
|
|
|
} from './services/user';
|
|
|
import defaultSettings from '../config/defaultSettings';
|
|
|
-import { BasicLayoutProps } from '@ant-design/pro-layout';
|
|
|
+import { Icon } from '@ant-design/compatible';
|
|
|
|
|
|
/**
|
|
|
* 获取用户信息比较慢的时候会展示一个 loading
|
|
@@ -67,11 +67,11 @@ export async function getInitialState(): Promise<{
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-//处理后端返回的菜单数据
|
|
|
+// 处理后端返回的菜单数据
|
|
|
const handleMenuList = (menuList)=>{
|
|
|
menuList.map((value)=>{
|
|
|
- console.debug(value.url)
|
|
|
value.path = value.url;
|
|
|
+ value.icon = <Icon type="copy" theme="filled" />;
|
|
|
if(value.subMenus){
|
|
|
value.routes = value.subMenus;
|
|
|
handleMenuList(value.routes);
|
|
@@ -100,8 +100,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }: {
|
|
|
}
|
|
|
},
|
|
|
menuDataRender: (menuData) => {
|
|
|
- console.debug(handleMenuList(initialState.menuData),'initialState.menuData')
|
|
|
- return initialState.menuData || menuData;
|
|
|
+ return initialState.menuData ? handleMenuList(initialState.menuData) : menuData;
|
|
|
},
|
|
|
menuHeaderRender: undefined,
|
|
|
// 自定义 403 页面
|