-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
85 lines (82 loc) · 2.38 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import React, { Component, Suspense } from 'react';
import ReactDOM from 'react-dom';
import {
Route,
Switch,
BrowserRouter as Router,
Redirect
} from 'react-router-dom'
import App from './App'
import Nav from './component/common/nav';
import { mainRoutes } from './routes'
import * as serviceWorker from './serviceWorker';
class Modest extends Component {
state = {
spinning: true
}
componentDidMount () {
window.setTimeout(() => {
this.setState({
spinning: false
})
}, 600)
}
render () {
return (
<Router>
<div className='wrap'>
<Nav></Nav>
<Suspense fallback={<div>Loading...</div>}>
<div className="fixcontainer"></div>
<Switch>
{/* 所有Admin的页面都走App这个组件 */}
{/* <Route
path="/admin"
render={routeProps => <Admin {...routeProps}></Admin>}>
</Route> */}
<Route
path="/blog"
render={routeProps => <App {...routeProps}></App>}>
</Route>
{
mainRoutes.map(route => {
return <Route key={route.path} {...route} />
})
}
<Route exact key='/' ></Route>
<Redirect to="/404"></Redirect>
</Switch>
</Suspense>
<footer style={{
width: "100%",
boxSizing: "border-box",
backgroundColor: "#333",
paddingTop: "10px",
position: "relative",
marginTop: "15px"
}} className="WAfooter">
<h5 style={{
textAlign: "center",
color: "white",
margin: "0px"
}}>本系统由React + Node + Ant Design联合驱动</h5>
<h5 style={{
textAlign: "center",
margin: "0px",
color: "white"
}}>
Copyright © 2019-2020 ModestFun All Rights Reserved V.1.0.0 备案号
<a href="http://www.beian.miit.gov.cn/publish/query/indexFirst.action?spm=a2c4g.11186623.2.12.4b497638zyCuzK&file=indexFirst.action"> 黑ICP备18005796号-3
</a>
</h5>
</footer>
</div>
</Router >
)
}
}
ReactDOM.render(
<Modest></Modest>,
document.getElementById('root')
);
serviceWorker.unregister();