|
@@ -1,36 +1,36 @@
|
1
|
|
-import React from "react";
|
2
|
|
-import { Spin, Layout } from "antd";
|
3
|
|
-import HtmlTitle from "./components/HtmlTitle";
|
|
1
|
+import React from 'react'
|
|
2
|
+import { Spin, Layout } from 'antd'
|
|
3
|
+import HtmlTitle from './components/HtmlTitle'
|
4
|
4
|
// import Main from './Main';
|
5
|
|
-import { useLocation, useNavigate } from "react-router-dom";
|
6
|
|
-import { useModel } from "@/store";
|
|
5
|
+import { useLocation, useNavigate } from 'react-router-dom'
|
|
6
|
+import { useModel } from '@/store'
|
7
|
7
|
|
8
|
|
-import SiderBar from "./components/SiderBar";
|
9
|
|
-import Header from "./components/Header";
|
10
|
|
-import Container from "./components/Container";
|
11
|
|
-import { authRoutes } from "@/routes/routes";
|
12
|
|
-import { getMenuItems } from "@/routes/menus";
|
13
|
|
-import RequireLogin from "./RequireLogin";
|
14
|
|
-import "./style.less";
|
|
8
|
+import SiderBar from './components/SiderBar'
|
|
9
|
+import Header from './components/Header'
|
|
10
|
+import Container from './components/Container'
|
|
11
|
+import { authRoutes } from '@/routes/routes'
|
|
12
|
+import { getMenuItems } from '@/routes/menus'
|
|
13
|
+import RequireLogin from './RequireLogin'
|
|
14
|
+import './style.less'
|
15
|
15
|
|
16
|
16
|
const Spinner = () => (
|
17
|
17
|
<div
|
18
|
18
|
style={{
|
19
|
|
- width: "100%",
|
20
|
|
- height: "100%",
|
21
|
|
- display: "grid",
|
22
|
|
- placeItems: "center",
|
|
19
|
+ width: '100%',
|
|
20
|
+ height: '100%',
|
|
21
|
+ display: 'grid',
|
|
22
|
+ placeItems: 'center',
|
23
|
23
|
}}
|
24
|
24
|
>
|
25
|
25
|
<Spin />
|
26
|
26
|
</div>
|
27
|
|
-);
|
|
27
|
+)
|
28
|
28
|
|
29
|
29
|
export default (props) => {
|
30
|
|
- const { theme } = useModel("system");
|
31
|
|
- const { user, menus } = useModel("user");
|
32
|
|
- const navigate = useNavigate();
|
33
|
|
- const location = useLocation();
|
|
30
|
+ const { theme } = useModel('system')
|
|
31
|
+ const { user, menus } = useModel('user')
|
|
32
|
+ const navigate = useNavigate()
|
|
33
|
+ const location = useLocation()
|
34
|
34
|
// const menus = getMenuItems(authRoutes);
|
35
|
35
|
// const RequireLogin = React.lazy(() => {
|
36
|
36
|
// return withLogin(import("./Main"));
|
|
@@ -42,15 +42,15 @@ export default (props) => {
|
42
|
42
|
<HtmlTitle />
|
43
|
43
|
{/* <React.Suspense fallback={<Spinner />}> */}
|
44
|
44
|
<RequireLogin>
|
45
|
|
- <Layout className={theme} style={{ height: "100vh" }}>
|
|
45
|
+ <Layout className={theme} style={{ height: '100vh' }}>
|
46
|
46
|
<Header theme={theme} user={user} />
|
47
|
|
- <Layout style={{ height: "calc(100vh - var(--header-height))" }}>
|
48
|
|
- <SiderBar theme={theme} menus={menus} location={location} />
|
|
47
|
+ <Layout style={{ height: 'calc(100vh - var(--header-height))' }}>
|
|
48
|
+ <SiderBar menus={menus} location={location} />
|
49
|
49
|
<Container location={location} />
|
50
|
50
|
</Layout>
|
51
|
51
|
</Layout>
|
52
|
52
|
</RequireLogin>
|
53
|
53
|
{/* </React.Suspense> */}
|
54
|
54
|
</Spin>
|
55
|
|
- );
|
56
|
|
-};
|
|
55
|
+ )
|
|
56
|
+}
|