react后台管理项目-路由-router.js

import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import PrivateRoute from '@/components/PrivateRoute';
import Login from '@/pages/Login';
import Index from '@/pages/Index';

const getRouter = () => (
    <Router>
        <Switch>
            <Route path="/login" component={Login} />
            <PrivateRoute path="/" component={Index} />
        </Switch>
    </Router>
);

export default getRouter;

posted on 2021-12-02 23:12  被窝暖暖嘻嘻嘻  阅读(165)  评论(0编辑  收藏  举报

导航