router.js 601 Bytes
Newer Older
1
import React from 'react';
afc163's avatar
afc163 committed
2
import { Router, Route, Switch } from 'dva/router';
afc163's avatar
afc163 committed
3 4
import { LocaleProvider } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
ddcat1115's avatar
ddcat1115 committed
5 6
import BasicLayout from './layouts/BasicLayout';
import UserLayout from './layouts/UserLayout';
7 8 9

function RouterConfig({ history }) {
  return (
afc163's avatar
afc163 committed
10 11
    <LocaleProvider locale={zhCN}>
      <Router history={history}>
ddcat1115's avatar
ddcat1115 committed
12 13 14 15
        <Switch>
          <Route path="/user" component={UserLayout} />
          <Route path="/" component={BasicLayout} />
        </Switch>
afc163's avatar
afc163 committed
16 17
      </Router>
    </LocaleProvider>
18 19 20 21
  );
}

export default RouterConfig;