|
@@ -1,5 +1,6 @@
|
1
|
1
|
import { requestConfig } from '@/utils/request';
|
2
|
2
|
import { history } from '@umijs/max';
|
|
3
|
+import { SettingDrawer } from '@ant-design/pro-components';
|
3
|
4
|
import defaultSettings from '../config/defaultSettings';
|
4
|
5
|
|
5
|
6
|
const isDev = process.env.NODE_ENV === 'development';
|
|
@@ -36,17 +37,17 @@ export async function getInitialState() {
|
36
|
37
|
|
37
|
38
|
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
38
|
39
|
export const layout = ({ initialState, setInitialState }) => {
|
39
|
|
- return {
|
|
40
|
+ const cfg = {
|
40
|
41
|
// rightContentRender: () => <RightContent />,
|
41
|
42
|
disableContentMargin: false,
|
42
|
43
|
token: {
|
43
|
44
|
sider: {
|
44
|
|
- menuBackgroundColor: '#001529',
|
45
|
|
- menuTitleTextColor: '#fff',
|
46
|
|
- menuTextColor: 'hsla(0,0%,100%,.65);',
|
47
|
|
- menuSubArrowColor: '#fff',
|
48
|
|
- menuItemSelectedBgColor: '#1890ff',
|
49
|
|
- menuSelectedTextColor: '#fff',
|
|
45
|
+ colorMenuBackground: '#001529',
|
|
46
|
+ colorTextMenuTitle: '#fff',
|
|
47
|
+ colorTextMenu: 'hsla(0,0%,100%,.65);',
|
|
48
|
+ colorBgMenuItemHover: '#fff',
|
|
49
|
+ colorBgMenuItemSelected: '#1890ff',
|
|
50
|
+ colorTextMenuSelected: '#fff',
|
50
|
51
|
},
|
51
|
52
|
},
|
52
|
53
|
// waterMarkProps: {
|
|
@@ -75,11 +76,32 @@ export const layout = ({ initialState, setInitialState }) => {
|
75
|
76
|
// 增加一个 loading 的状态
|
76
|
77
|
childrenRender: (children, props) => {
|
77
|
78
|
// if (initialState?.loading) return <PageLoading />;
|
78
|
|
- return <>{children}</>;
|
|
79
|
+ return (
|
|
80
|
+ <>
|
|
81
|
+ {children}
|
|
82
|
+ {/* {!props.location?.pathname?.includes('/login') && (
|
|
83
|
+ <SettingDrawer
|
|
84
|
+ disableUrlParams
|
|
85
|
+ enableDarkTheme
|
|
86
|
+ settings={initialState?.settings}
|
|
87
|
+ onSettingChange={(settings) => {
|
|
88
|
+ setInitialState((preInitialState) => ({
|
|
89
|
+ ...preInitialState,
|
|
90
|
+ settings,
|
|
91
|
+ }));
|
|
92
|
+ }}
|
|
93
|
+ />
|
|
94
|
+ )} */}
|
|
95
|
+ </>
|
|
96
|
+ );
|
79
|
97
|
},
|
80
|
98
|
|
81
|
|
- ...initialState?.settings,
|
|
99
|
+ settings: initialState?.settings,
|
82
|
100
|
};
|
|
101
|
+
|
|
102
|
+ console.log(cfg)
|
|
103
|
+
|
|
104
|
+ return cfg;
|
83
|
105
|
};
|
84
|
106
|
|
85
|
107
|
export const request = requestConfig;
|