index.js 670 B

1234567891011121314151617181920212223242526
  1. import {
  2. BrowserRouter as Router,
  3. Switch,
  4. Route,
  5. Redirect
  6. } from "react-router-dom";
  7. import RouteWithSubRoutes from '@utils/RouteWithSubRoutes'
  8. import routes from '@utils/routes';
  9. export default function AuthIndex() {
  10. //const user = localStorage.getItem("token");
  11. return (
  12. <Router>
  13. <Switch>
  14. <Route
  15. exact
  16. path="/"
  17. render={() => <Redirect to="/login" />}
  18. />
  19. {routes.map(route => (
  20. <RouteWithSubRoutes key={route.path} {...route} />
  21. ))}
  22. </Switch>
  23. </Router>
  24. )
  25. }