-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
37 lines (35 loc) · 1.27 KB
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { Router, Route, Redirect, IndexRoute } from 'dva/router';
import ItemPage from './routes/ItemPage';
import UserPage from './routes/UserPage';
import CommentPage from './routes/CommentPage';
function RouterConfig({app, history}) {
return (
<Router history={history}>
<Redirect from="/" to='/top' />
<Route path="/top">
<IndexRoute component={ItemPage}></IndexRoute>
<Route path=":page" component={ItemPage}></Route>
</Route>
<Route path="/new">
<IndexRoute component={ItemPage}></IndexRoute>
<Route path=":page" component={ItemPage}></Route>
</Route>
<Route path="/show">
<IndexRoute component={ItemPage}></IndexRoute>
<Route path=":page" component={ItemPage}></Route>
</Route>
<Route path="/ask">
<IndexRoute component={ItemPage}></IndexRoute>
<Route path=":page" component={ItemPage}></Route>
</Route>
<Route path="/job">
<IndexRoute component={ItemPage}></IndexRoute>
<Route path=":page" component={ItemPage}></Route>
</Route>
<Route path="/user/:name" component={UserPage}></Route>
<Route path="/comment/:id" component={CommentPage}></Route>
</Router>
);
}
export default RouterConfig;