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 { HashRouter, Switch, Route, Redirect } from 'react-router-dom'
|
||||
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
|
@ -13,7 +14,10 @@ function App() {
|
|||
<HashRouter>
|
||||
<Switch><Route path='/login' component={User} /></Switch>
|
||||
<Switch><Route path='/home' component={Home} /></Switch>
|
||||
<Redirect from="/" to="/home" exact />
|
||||
<Redirect from="/" to={(() => {
|
||||
return localStorage.getItem("token") ?
|
||||
'/home' : '/login'
|
||||
})()} exact />
|
||||
</HashRouter>
|
||||
</div>
|
||||
</Provider>
|
||||
|
|
Loading…
Reference in New Issue