-
Notifications
You must be signed in to change notification settings - Fork 9
/
initApp.js
35 lines (32 loc) · 1.07 KB
/
initApp.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
import PropTypes from 'prop-types';
import React from 'react';
import { Route } from 'react-router';
import { Master, Layout } from './pages';
import Gate from './containers/Gate';
import LoginPage from './components/LoginPage';
import SsoPage from './components/SsoPage';
const App = ({routes, masterRoutes, extLayout, extMaster}) => {
return (
<Route>
<Route path='/login' component={LoginPage} />
<Route path='/sso/:appId/:ssoOrigin/login' component={LoginPage} />
<Route component={Gate}>
<Route path='/sso/:appId/:ssoOrigin' component={SsoPage} />
<Route component={extMaster || Master}>
<Route component={extLayout || Layout}>
{routes}
</Route>
{masterRoutes}
</Route>
</Route>
</Route>
);
};
App.propTypes = {
masterRoutes: PropTypes.node,
routes: PropTypes.node,
extLayout: PropTypes.node,
extMaster: PropTypes.node,
images: PropTypes.object
};
export default App;