index.js 1.94 KB
Newer Older
bert committed
1
import React, { PropTypes } from 'react';
bert committed
2 3
import { Router, Route, IndexRoute, Link, IndexRedirect } from 'react-router';
import App from '../views/App';
bert committed
4
import Home from '../views/Home';
bert committed
5
import Login from '../views/Login';
bert committed
6
import Test from '../views/Test';
bert committed
7
import Feature1 from '../feature/Feature1';
bert committed
8 9
import Feature1_1 from '../feature/Feature1-1';
import Feature1_3 from '../feature/Feature1-3';
bert committed
10
import NotFound from '../components/NotFound';
bert committed
11
import Loding from '../components/Loding';
fukai committed
12 13 14 15
import SWFPage from "../swift/SWFPage2"
import LeadPage from "../swift/LeadPage"
import Preview from "../swift/Preview"
import Result from "../swift/Result"
bert committed
16

bert committed
17 18 19 20
function validate() {
  // 在路由群载入时做 filter 处理
}

bert committed
21
const Routes = ({ history }) =>
fukai committed
22 23
  <Router history={history} basename="/swiftedit">
    {/*<Route path="/login" component={Login}/>*/}
bert committed
24 25 26
    <Route path="/" onEnter={validate}>
      <IndexRedirect to="home" />
      <Route component={App}>
fukai committed
27 28 29 30 31
        <Route path="home" component={LeadPage}/>

        <Route path="home/:mctid" component={LeadPage}/>
        
        <Route path="lead/:mctid" component={LeadPage}/>
fukai committed
32
        <Route path="swift/:action/:key" component={SWFPage}/>
fukai committed
33 34 35
        <Route path="swift/:action/:mctid/:key" component={SWFPage}/>
        <Route path="swift/:action/:mctid/:key/:rcvbic" component={SWFPage}/>
        <Route path="swift/:action/:mctid/:key/:sndbic/:rcvbic" component={SWFPage}/>
fukai committed
36
        <Route path="swift/:action/:mctid/:key/:gentyp" component={SWFPage}/>
bert committed
37
        <Route path="app" component={App}/>
fukai committed
38 39
        <Route path="preview/:kind" component={Preview}/>
        <Route path="result/:kind" component={Result}/>
bert committed
40
        <Route path="feature1" component={Feature1}/>
bert committed
41 42
        <Route path="feature1_1" component={Feature1_1}/>
        <Route path="feature1_3" component={Feature1_3}/>
bert committed
43
      </Route>
bert committed
44
    </Route>
bert committed
45

bert committed
46 47 48 49 50 51 52 53
    <Route path="*" component={NotFound}/>
  </Router>;

Routes.propTypes = {
  history: PropTypes.any,
};

export default Routes;