2019-06-26 17:41:01 +08:00
|
|
|
import React, { Component } from "react";
|
2019-06-27 11:32:03 +08:00
|
|
|
import { Route, Switch, Redirect } from "react-router-dom";
|
2019-06-26 17:41:01 +08:00
|
|
|
import { withRouter } from "react-router-dom";
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
import store from "./redux";
|
2019-06-27 11:32:03 +08:00
|
|
|
import NotFound from "./pages/public/notFound/NotFound";
|
2019-06-26 17:41:01 +08:00
|
|
|
|
2019-07-06 11:07:53 +08:00
|
|
|
import Login from "./pages/public/Login";
|
|
|
|
import RegisterOrReset from "./pages/public/RegisterOrReset";
|
|
|
|
|
2019-07-10 16:58:51 +08:00
|
|
|
import ManageOverview from "./pages/manage/OverView";
|
|
|
|
|
2019-06-26 17:41:01 +08:00
|
|
|
class App extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const mainStyle = {
|
2019-06-27 17:31:55 +08:00
|
|
|
fontSize: "0.14rem"
|
2019-06-26 17:41:01 +08:00
|
|
|
};
|
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
|
|
|
<div className="fullScreen" style={mainStyle}>
|
2019-06-27 11:32:03 +08:00
|
|
|
<Switch>
|
2019-07-10 16:58:51 +08:00
|
|
|
<Redirect exact path="/" to="/manage/overview" />
|
|
|
|
<Route exact path="/manage/overview" component={ManageOverview} />
|
|
|
|
|
|
|
|
{/* 公共页面 */}
|
2019-06-27 11:32:03 +08:00
|
|
|
<Route exact path="/public/login" component={Login} />
|
2019-07-06 11:07:53 +08:00
|
|
|
<Route exact path="/public/register" component={RegisterOrReset} />
|
|
|
|
<Route exact path="/public/resetPassword" component={RegisterOrReset} />
|
2019-06-27 11:32:03 +08:00
|
|
|
<Route exact path="/404" component={NotFound} />
|
|
|
|
{/* 当前面的路由都匹配不到时就会重定向到/404 */}
|
|
|
|
<Redirect path="/" to="/404" />
|
|
|
|
</Switch>
|
2019-06-26 17:41:01 +08:00
|
|
|
</div>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withRouter(App);
|