mode
This commit is contained in:
parent
3e438ff723
commit
8da40f804a
|
@ -6,6 +6,7 @@ import Home from '@/pages/home'
|
||||||
import { Provider } from "react-redux"
|
import { Provider } from "react-redux"
|
||||||
import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'
|
import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'
|
||||||
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
|
@ -13,7 +14,10 @@ function App() {
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Switch><Route path='/login' component={User} /></Switch>
|
<Switch><Route path='/login' component={User} /></Switch>
|
||||||
<Switch><Route path='/home' component={Home} /></Switch>
|
<Switch><Route path='/home' component={Home} /></Switch>
|
||||||
<Redirect from="/" to="/home" exact />
|
<Redirect from="/" to={(() => {
|
||||||
|
return localStorage.getItem("token") ?
|
||||||
|
'/home' : '/login'
|
||||||
|
})()} exact />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
</div>
|
</div>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|
Loading…
Reference in New Issue