|
|
@@ -2,42 +2,17 @@ import React from 'react';
|
|
|
import { LocaleProvider } from 'antd';
|
|
|
import { Router, Route, Switch } from 'dva/router';
|
|
|
import PrivateRoute from './privateRoute';
|
|
|
-// import Login from '../components/common/login/login';
|
|
|
-// import Register from '../components/common/login/register';
|
|
|
import MainLayout from './mainLayout';
|
|
|
-// import ChartDesigner from '../components/chartDesigner/layout';
|
|
|
-// import DashboardView from '../components/dashboard/view';
|
|
|
-// import DashboardShareView from '../components/dashboard/shareView';
|
|
|
-// import DashboardShareKeyView from '../components/dashboard/shareKeyView';
|
|
|
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
|
|
|
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
|
|
-import Loadable from 'react-loadable';
|
|
|
-import Skeleton from 'components/common/skeleton';
|
|
|
+import Loadable from 'utils/loadable';
|
|
|
|
|
|
-const Login = Loadable({
|
|
|
- loader: () => import('components/common/login/login'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
-const Register = Loadable({
|
|
|
- loader: () => import('components/common/login/register'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
-const ChartDesigner = Loadable({
|
|
|
- loader: () => import('components/chartDesigner/layout'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
-const DashboardView = Loadable({
|
|
|
- loader: () => import('components/dashboard/view'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
-const DashboardShareView = Loadable({
|
|
|
- loader: () => import('components/dashboard/shareView'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
-const DashboardShareKeyView = Loadable({
|
|
|
- loader: () => import('components/dashboard/shareKeyView'),
|
|
|
- loading: () => <Skeleton />
|
|
|
-});
|
|
|
+const Login = Loadable(() => import('components/common/login/login'));
|
|
|
+const Register = Loadable(() => import('components/common/login/register'));
|
|
|
+const ChartDesigner = Loadable(() => import('components/chartDesigner/layout'));
|
|
|
+const DashboardView = Loadable(() => import('components/dashboard/view'));
|
|
|
+const DashboardShareView = Loadable(() => import('components/dashboard/shareView'));
|
|
|
+const DashboardShareKeyView = Loadable(() => import('components/dashboard/shareKeyView'));
|
|
|
|
|
|
function RouterConfig({ history }) {
|
|
|
return (
|