diff --git a/package.json b/package.json index 89aa770a0406983032204a97e1bc304e034c71c9..3b31160e1aac95ace531d8e052d1fe8db0174a95 100755 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "mockjs": "^1.0.1-beta3", "prettier": "1.13.7", "pro-download": "^1.0.1", + "react-loadable": "^5.4.0", "redbox-react": "^1.5.0", "regenerator-runtime": "^0.12.0", "stylelint": "^9.2.1", diff --git a/src/router.js b/src/router.js index 9cbe5402147f0b057380c05b2cd44959ec838736..36166bd2528c47b3ba0b62e4699ff923fb7a5f4d 100644 --- a/src/router.js +++ b/src/router.js @@ -1,39 +1,30 @@ import React from 'react'; import { routerRedux, Route, Switch } from 'dva/router'; -import { Spin } from 'antd'; -import dynamic from 'dva/dynamic'; import { getRouterData } from './common/router'; import Authorized from './utils/Authorized'; import { getQueryPath } from './utils/utils'; -import { LocalComponent } from './locale/localeContext'; -import styles from './index.less'; const { ConnectedRouter } = routerRedux; const { AuthorizedRoute } = Authorized; -dynamic.setDefaultLoadingComponent(() => { - return ; -}); function RouterConfig({ history, app }) { const routerData = getRouterData(app); const UserLayout = routerData['/user'].component; const BasicLayout = routerData['/'].component; return ( - - - - - } - authority={['admin', 'user']} - redirectPath={getQueryPath('/user/login', { - redirect: window.location.href, - })} - /> - - - + + + + } + authority={['admin', 'user']} + redirectPath={getQueryPath('/user/login', { + redirect: window.location.href, + })} + /> + + ); }