2021-10-25 17:45:14 +08:00
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
|
|
|
import "./App.css"
|
|
|
|
import "./assets/comm.css"
|
2021-10-29 14:47:23 +08:00
|
|
|
import {Redirect} from "react-router-dom";
|
2021-10-25 17:45:14 +08:00
|
|
|
import { Avatar, Badge } from 'zent';
|
2021-10-29 14:47:23 +08:00
|
|
|
import login from './pages/login/login';
|
|
|
|
import home from './pages/home/home';
|
2021-10-25 17:45:14 +08:00
|
|
|
export default class App extends Component {
|
|
|
|
state = {
|
|
|
|
pathname:'',
|
|
|
|
};
|
|
|
|
componentWillMount(){
|
|
|
|
const pathname=window.location.href.lastIndexOf('\/');
|
|
|
|
const pathnamestr=window.location.href.substr(pathname);
|
|
|
|
this.setState({pathname:`${pathnamestr}`});
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2021-10-29 14:47:23 +08:00
|
|
|
<Router>
|
2021-11-02 09:32:55 +08:00
|
|
|
<Route path="/login" exact={true} component={login} />
|
2021-11-06 13:36:21 +08:00
|
|
|
<Route path="/home" component={home} />
|
2021-11-08 16:52:56 +08:00
|
|
|
{/* <Route exact={true} path="/home" render={
|
2021-11-06 13:36:21 +08:00
|
|
|
()=> (
|
2021-11-08 16:31:48 +08:00
|
|
|
<Redirect to="/home#/system/account-list"/>)}>
|
2021-11-08 16:52:56 +08:00
|
|
|
</Route> */}
|
2021-11-02 09:32:55 +08:00
|
|
|
<Route exact={true} path="/" render={
|
2021-10-29 14:47:23 +08:00
|
|
|
()=> (
|
|
|
|
<Redirect to="/login"/>)}>
|
|
|
|
</Route>
|
2021-11-06 13:36:21 +08:00
|
|
|
|
2021-10-25 17:45:14 +08:00
|
|
|
</Router>
|
|
|
|
);
|
|
|
|
}
|
2021-10-25 11:49:03 +08:00
|
|
|
}
|
|
|
|
|