diff --git a/.webpackrc.js b/.webpackrc.js deleted file mode 100755 index cf91d6d69ef834a5671e36c8e32ed0c711cf4313..0000000000000000000000000000000000000000 --- a/.webpackrc.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require('path'); - -export default { - entry: 'src/index.js', - extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], - env: { - development: { - extraBabelPlugins: ['dva-hmr'], - }, - }, - externals: { - '@antv/data-set': 'DataSet', - rollbar: 'rollbar', - }, - alias: { - components: path.resolve(__dirname, 'src/components/'), - }, - ignoreMomentLocale: true, - theme: './src/theme.js', - html: { - template: './src/index.ejs', - }, - lessLoaderOptions: { - javascriptEnabled: true, - }, - disableDynamicImport: true, - publicPath: '/', - hash: true, -}; diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000000000000000000000000000000000000..9828fd0ed3538d934dcd717d0a3c9a50e17fa454 --- /dev/null +++ b/config/config.js @@ -0,0 +1,31 @@ +import routerConfig from './router.config'; + +export default { + plugins: [ + [ + 'umi-plugin-react', + { + antd: true, + dva: { + hmr: true, + }, + }, + ], + ], + externals: { + '@antv/data-set': 'DataSet', + rollbar: 'rollbar', + }, + ignoreMomentLocale: true, + theme: { + // 'primary-color': '#10e99b', + 'card-actions-background': '#f5f8fa', + }, + lessLoaderOptions: { + javascriptEnabled: true, + }, + disableDynamicImport: true, + publicPath: '/', + hash: true, + routes: routerConfig, +}; diff --git a/config/router.config.js b/config/router.config.js new file mode 100644 index 0000000000000000000000000000000000000000..95dd9e065c7e9c2ce5cae30711a4b813f6c0f38e --- /dev/null +++ b/config/router.config.js @@ -0,0 +1,20 @@ +module.exports = [ + { + path: '/', + component: '../layouts/BasicLayout', + routes: [ + // dashboard + { path: '/', redirect: '/dashboard/analysis' }, + { + path: '/dashboard', + name: 'dashboard', + icon: 'dashboard', + routes: [ + { path: '/dashboard/analysis', name: 'analysis', component: './Dashboard/Analysis' }, + { path: '/dashboard/monitor', name: 'monitor', component: './Dashboard/Monitor' }, + { path: '/dashboard/workplace', name: 'workplace', component: './Dashboard/Workplace' }, + ], + }, + ], + }, +]; diff --git a/mock/api.js b/mock/api.js index a274afb9bc24a1b20fa703cd45ba50a3532a5d85..56399669aa2d86ca8d75a092899b82d7295b31d0 100644 --- a/mock/api.js +++ b/mock/api.js @@ -1,4 +1,5 @@ import { parse } from 'url'; +import mockjs from 'mockjs'; const titles = [ 'Alipay', @@ -69,7 +70,7 @@ export function fakeList(count) { owner: user[i % 10], title: titles[i % 8], avatar: avatars[i % 8], - cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - i % 4], + cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)], status: ['active', 'exception', 'normal'][i % 3], percent: Math.ceil(Math.random() * 50) + 50, logo: avatars[i % 8], @@ -290,7 +291,14 @@ export const getActivities = [ ]; export default { - getNotice, - getActivities, - getFakeList, + 'GET /api/project/notice': getNotice, + 'GET /api/activities': getActivities, + + 'POST /api/forms': (req, res) => { + res.send({ message: 'Ok' }); + }, + 'GET /api/tags': mockjs.mock({ + 'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }], + }), + 'GET /api/fake_list': getFakeList, }; diff --git a/mock/chart.js b/mock/chart.js index 55c8a412dbb080897ca50f8285307b48b18e70c7..a5a37efecca80b9e64da6f5cbba7309cd4ceddc6 100644 --- a/mock/chart.js +++ b/mock/chart.js @@ -193,5 +193,5 @@ export const getFakeChartData = { }; export default { - getFakeChartData, + 'GET /api/fake_chart_data': getFakeChartData, }; diff --git a/.roadhogrc.mock.js b/mock/common.js similarity index 61% rename from .roadhogrc.mock.js rename to mock/common.js index af60fec12a079141debe9f931a61595656ffd762..6dc9f8c192161316de8d11859bfb5944d9dd5915 100644 --- a/.roadhogrc.mock.js +++ b/mock/common.js @@ -1,32 +1,12 @@ import mockjs from 'mockjs'; -import { getRule, postRule } from './mock/rule'; -import { getActivities, getNotice, getFakeList } from './mock/api'; -import { getFakeChartData } from './mock/chart'; -import { getProfileBasicData } from './mock/profile'; -import { getProfileAdvancedData } from './mock/profile'; -import { getNotices } from './mock/notices'; -import { format, delay } from 'roadhog-api-doc'; -// 是否禁用代理 -const noProxy = process.env.NO_PROXY === 'true'; - -// 代码中会兼容本地 service mock 以及部署站点的静态数据 -const proxy = { +export default { // 支持值为 Object 和 Array 'GET /api/currentUser': { - $desc: '获取当前用户接口', - $params: { - pageSize: { - desc: '分页', - exp: 2, - }, - }, - $body: { - name: 'Serati Ma', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', - userid: '00000001', - notifyCount: 12, - }, + name: 'Serati Ma', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', + userid: '00000001', + notifyCount: 12, }, // GET POST 可省略 'GET /api/users': [ @@ -49,28 +29,12 @@ const proxy = { address: 'Sidney No. 1 Lake Park', }, ], - 'GET /api/project/notice': getNotice, - 'GET /api/activities': getActivities, - 'GET /api/rule': getRule, - 'POST /api/rule': { - $params: { - pageSize: { - desc: '分页', - exp: 2, - }, - }, - $body: postRule, - }, 'POST /api/forms': (req, res) => { res.send({ message: 'Ok' }); }, 'GET /api/tags': mockjs.mock({ 'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }], }), - 'GET /api/fake_list': getFakeList, - 'GET /api/fake_chart_data': getFakeChartData, - 'GET /api/profile/basic': getProfileBasicData, - 'GET /api/profile/advanced': getProfileAdvancedData, 'POST /api/login/account': (req, res) => { const { password, userName, type } = req.body; if (password === '888888' && userName === 'admin') { @@ -98,7 +62,6 @@ const proxy = { 'POST /api/register': (req, res) => { res.send({ status: 'ok', currentAuthority: 'user' }); }, - 'GET /api/notices': getNotices, 'GET /api/500': (req, res) => { res.status(500).send({ timestamp: 1513932555104, @@ -136,5 +99,3 @@ const proxy = { }); }, }; - -export default (noProxy ? {} : delay(proxy, 1000)); diff --git a/mock/notices.js b/mock/notices.js index 7e1b3ce43d2f1155eb08da70bfd37827893e8ca1..6b4e9e233918fcd948343e3121f23ebcf4f4adac 100644 --- a/mock/notices.js +++ b/mock/notices.js @@ -95,5 +95,5 @@ export const getNotices = (req, res) => { ]); }; export default { - getNotices, + 'GET /api/notices': getNotices, }; diff --git a/mock/profile.js b/mock/profile.js index 7c24be1bdae0f4cc1bbd3556cbf401e62effce22..40b2b06327aec12d94cd69e3237e23a2fcfcc663 100644 --- a/mock/profile.js +++ b/mock/profile.js @@ -153,6 +153,6 @@ export const getProfileAdvancedData = { }; export default { - getProfileBasicData, - getProfileAdvancedData, + 'GET /api/profile/basic': getProfileBasicData, + 'GET /api/profile/advanced': getProfileAdvancedData, }; diff --git a/mock/rule.js b/mock/rule.js index e89b9496fa7c976b0791371c7c591cbcd0fe1ff0..7cd895cefc1e15e2b2f580fb375592d2bd9a4859 100644 --- a/mock/rule.js +++ b/mock/rule.js @@ -132,6 +132,14 @@ export function postRule(req, res, u, b) { } export default { - getRule, - postRule, + 'GET /api/rule': getRule, + 'POST /api/rule': { + $params: { + pageSize: { + desc: '分页', + exp: 2, + }, + }, + $body: postRule, + }, }; diff --git a/package.json b/package.json index be94cc6b085255fc8a838652069fa2243be68a32..95e71148c76940eb4a4182c0e9b21bb69a5eb319 100755 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "private": true, "scripts": { "precommit": "npm run lint-staged", - "start": "cross-env ESLINT=none roadhog dev", - "start:no-proxy": "cross-env NO_PROXY=true ESLINT=none roadhog dev", - "build": "cross-env ESLINT=none roadhog build", + "start": "umi dev", + "start:no-mock": "cross-env MOCK=none umi dev", + "build": "umi build", "site": "roadhog-api-doc static && gh-pages -d dist", "analyze": "cross-env ANALYZE=true roadhog build", "lint:style": "stylelint \"src/**/*.less\" --syntax less", @@ -27,25 +27,24 @@ "bizcharts": "^3.1.10", "bizcharts-plugin-slider": "^2.0.1", "classnames": "^2.2.5", - "dva": "^2.2.3", - "dva-loading": "^2.0.3", "enquire-js": "^0.2.1", "lodash": "^4.17.10", "lodash-decorators": "^6.0.0", + "lodash.isequal": "^4.5.0", + "memoize-one": "^4.0.0", "moment": "^2.19.3", "numeral": "^2.0.6", "omit.js": "^1.0.0", "path-to-regexp": "^2.1.0", "prop-types": "^15.5.10", "qs": "^6.5.0", - "react": "^16.4.1", "react-container-query": "^0.11.0", "react-document-title": "^2.0.3", - "react-dom": "^16.4.1", "react-fittext": "^1.0.0", - "react-loadable": "^5.5.0", "rollbar": "^2.3.4", "setprototypeof": "^1.1.0", + "umi": "^2.0.0-beta.10", + "umi-plugin-react": "^1.0.0-beta.10", "url-polyfill": "^1.0.10" }, "devDependencies": { diff --git a/src/common/router.js b/src/common/router.js deleted file mode 100644 index 269ed7a7cf0f1fe091edafec6c83d82055644aa6..0000000000000000000000000000000000000000 --- a/src/common/router.js +++ /dev/null @@ -1,231 +0,0 @@ -import React, { createElement } from 'react'; -import { Spin } from 'antd'; -import pathToRegexp from 'path-to-regexp'; -import Loadable from 'react-loadable'; -import { getMenuData } from './menu'; - -let routerDataCache; - -const getRouterDataCache = app => { - if (!routerDataCache) { - routerDataCache = getRouterData(app); - } - return routerDataCache; -}; - -const modelNotExisted = (app, model) => - // eslint-disable-next-line - !app._models.some(({ namespace }) => { - return namespace === model.substring(model.lastIndexOf('/') + 1); - }); - -// wrapper of dynamic -const dynamicWrapper = (app, models, component) => { - // register models - models.forEach(model => { - if (modelNotExisted(app, model)) { - // eslint-disable-next-line - app.model(require(`../models/${model}`).default); - } - }); - - // () => require('module') - // transformed by babel-plugin-dynamic-import-node-sync - if (component.toString().indexOf('.then(') < 0) { - return props => { - return createElement(component().default, { - ...props, - routerData: getRouterDataCache(app), - }); - }; - } - // () => import('module') - return Loadable({ - loader: () => { - return component().then(raw => { - const Component = raw.default || raw; - return props => - createElement(Component, { - ...props, - routerData: getRouterDataCache(app), - }); - }); - }, - loading: () => { - return ; - }, - }); -}; - -function getFlatMenuData(menus) { - let keys = {}; - menus.forEach(item => { - if (item.children) { - keys[item.path] = { ...item }; - keys = { ...keys, ...getFlatMenuData(item.children) }; - } else { - keys[item.path] = { ...item }; - } - }); - return keys; -} - -function findMenuKey(menuData, path) { - const menuKey = Object.keys(menuData).find(key => pathToRegexp(path).test(key)); - if (menuKey == null) { - if (path === '/') { - return null; - } - const lastIdx = path.lastIndexOf('/'); - if (lastIdx < 0) { - return null; - } - if (lastIdx === 0) { - return findMenuKey(menuData, '/'); - } - // 如果没有,使用上一层的配置 - return findMenuKey(menuData, path.substr(0, lastIdx)); - } - return menuKey; -} - -export const getRouterData = app => { - const routerConfig = { - '/': { - component: dynamicWrapper(app, ['user', 'login'], () => import('../layouts/BasicLayout')), - }, - '/dashboard/analysis': { - component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')), - }, - '/dashboard/monitor': { - component: dynamicWrapper(app, ['monitor'], () => import('../routes/Dashboard/Monitor')), - }, - '/dashboard/workplace': { - component: dynamicWrapper(app, ['project', 'activities', 'chart'], () => - import('../routes/Dashboard/Workplace') - ), - // hideInBreadcrumb: true, - // name: '工作台', - // authority: 'admin', - }, - '/form/basic-form': { - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/BasicForm')), - }, - '/form/step-form': { - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm')), - }, - '/form/step-form/info': { - name: '分步表单(填写转账信息)', - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step1')), - }, - '/form/step-form/confirm': { - name: '分步表单(确认转账信息)', - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step2')), - }, - '/form/step-form/result': { - name: '分步表单(完成)', - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step3')), - }, - '/form/advanced-form': { - component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/AdvancedForm')), - }, - '/list/table-list': { - component: dynamicWrapper(app, ['rule'], () => import('../routes/List/TableList')), - }, - '/list/basic-list': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/BasicList')), - }, - '/list/card-list': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/CardList')), - }, - '/list/search': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/List')), - }, - '/list/search/projects': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/Projects')), - }, - '/list/search/applications': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/Applications')), - }, - '/list/search/articles': { - component: dynamicWrapper(app, ['list'], () => import('../routes/List/Articles')), - }, - '/profile/basic': { - component: dynamicWrapper(app, ['profile'], () => import('../routes/Profile/BasicProfile')), - }, - '/profile/advanced': { - component: dynamicWrapper(app, ['profile'], () => - import('../routes/Profile/AdvancedProfile') - ), - }, - '/result/success': { - component: dynamicWrapper(app, [], () => import('../routes/Result/Success')), - }, - '/result/fail': { - component: dynamicWrapper(app, [], () => import('../routes/Result/Error')), - }, - '/exception/403': { - component: dynamicWrapper(app, [], () => import('../routes/Exception/403')), - }, - '/exception/404': { - component: dynamicWrapper(app, [], () => import('../routes/Exception/404')), - }, - '/exception/500': { - component: dynamicWrapper(app, [], () => import('../routes/Exception/500')), - }, - '/exception/trigger': { - component: dynamicWrapper(app, ['error'], () => - import('../routes/Exception/triggerException') - ), - }, - '/user': { - component: dynamicWrapper(app, [], () => import('../layouts/UserLayout')), - }, - '/user/login': { - component: dynamicWrapper(app, ['login'], () => import('../routes/User/Login')), - }, - '/user/register': { - component: dynamicWrapper(app, ['register'], () => import('../routes/User/Register')), - }, - '/user/register-result': { - component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')), - }, - // '/user/:id': { - // component: dynamicWrapper(app, [], () => import('../routes/User/SomeComponent')), - // }, - }; - // Get name from ./menu.js or just set it in the router data. - const menuData = getFlatMenuData(getMenuData()); - - // Route configuration data - // eg. {name,authority ...routerConfig } - const routerData = {}; - // The route matches the menu - Object.keys(routerConfig).forEach(path => { - // Regular match item name - // eg. router /user/:id === /user/chen - let menuKey = Object.keys(menuData).find(key => pathToRegexp(path).test(`${key}`)); - const inherited = menuKey == null; - if (menuKey == null) { - menuKey = findMenuKey(menuData, path); - } - let menuItem = {}; - // If menuKey is not empty - if (menuKey) { - menuItem = menuData[menuKey]; - } - let router = routerConfig[path]; - // If you need to configure complex parameter routing, - // https://github.com/ant-design/ant-design-pro-site/blob/master/docs/router-and-nav.md#%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E8%B7%AF%E7%94%B1%E8%8F%9C%E5%8D%95 - // eg . /list/:type/user/info/:id - router = { - ...router, - name: router.name || menuItem.name, - authority: router.authority || menuItem.authority, - hideInBreadcrumb: router.hideInBreadcrumb || menuItem.hideInBreadcrumb, - inherited, - }; - routerData[path] = router; - }); - return routerData; -}; diff --git a/src/global.js b/src/global.js new file mode 100644 index 0000000000000000000000000000000000000000..4c9a2bd642713c7fcde3ca3d71c3e53f302248f2 --- /dev/null +++ b/src/global.js @@ -0,0 +1,3 @@ +import './polyfill'; +import 'moment/locale/zh-cn'; +import './rollbar'; diff --git a/src/global.less b/src/global.less new file mode 100644 index 0000000000000000000000000000000000000000..de79b39d53c403dcdd5fc639063176692117c052 --- /dev/null +++ b/src/global.less @@ -0,0 +1,28 @@ +html, +body, +#root { + height: 100%; +} + +.ant-layout { + min-height: 100%; +} + +canvas { + display: block; +} + +body { + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.ant-spin-container { + overflow: visible !important; +} + +.global-spin { + width: 100%; + margin: 40px 0 !important; +} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 27a33c83374bc8081bcaf361a2fe44ed8fc7f079..0000000000000000000000000000000000000000 --- a/src/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import './polyfill'; -import dva from 'dva'; - -import createHistory from 'history/createHashHistory'; -// user BrowserHistory -// import createHistory from 'history/createBrowserHistory'; -import createLoading from 'dva-loading'; -import 'moment/locale/zh-cn'; -import './rollbar'; - -import './index.less'; -// 1. Initialize -const app = dva({ - history: createHistory(), -}); - -// 2. Plugins -app.use(createLoading()); - -// 3. Register global model -app.model(require('./models/global').default); - -// 4. Router -app.router(require('./router').default); - -// 5. Start -app.start('#root'); - -export default app._store; // eslint-disable-line diff --git a/src/index.less b/src/index.less deleted file mode 100644 index 3a277746da655bb51320bc4e39ee2635dcc96d6d..0000000000000000000000000000000000000000 --- a/src/index.less +++ /dev/null @@ -1,31 +0,0 @@ -html, -body, -:global(#root) { - height: 100%; -} - -:global(.ant-layout) { - min-height: 100%; -} - -canvas { - display: block; -} - -body { - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -// temp fix for https://github.com/ant-design/ant-design/commit/a1fafb5b727b62cb0be29ce6e9eca8f579d4f8b7 -:global { - .ant-spin-container { - overflow: visible !important; - } - - .global-spin { - width: 100%; - margin: 40px 0 !important; - } -} diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index fbb35bd9092f23d8c0cfb9fa604263398ae50fe6..8081050b826d5a33cb27d863f718884e51705fbe 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -3,22 +3,22 @@ import PropTypes from 'prop-types'; import { Layout, Icon, message } from 'antd'; import DocumentTitle from 'react-document-title'; import { connect } from 'dva'; -import { Route, Redirect, Switch, routerRedux } from 'dva/router'; +import { routerRedux } from 'dva/router'; import { ContainerQuery } from 'react-container-query'; import classNames from 'classnames'; import pathToRegexp from 'path-to-regexp'; import { enquireScreen, unenquireScreen } from 'enquire-js'; +import memoizeOne from 'memoize-one'; +import deepEqual from 'lodash.isequal'; import GlobalHeader from '../components/GlobalHeader'; import GlobalFooter from '../components/GlobalFooter'; import SiderMenu from '../components/SiderMenu'; -import NotFound from '../routes/Exception/404'; -import { getRoutes } from '../utils/utils'; import Authorized from '../utils/Authorized'; import { getMenuData } from '../common/menu'; import logo from '../assets/logo.svg'; const { Content, Header, Footer } = Layout; -const { AuthorizedRoute, check } = Authorized; +const { check } = Authorized; /** * 根据菜单取得重定向地址. @@ -42,21 +42,21 @@ getMenuData().forEach(getRedirect); /** * 获取面包屑映射 * @param {Object} menuData 菜单配置 - * @param {Object} routerData 路由配置 */ -const getBreadcrumbNameMap = (menuData, routerData) => { - const result = {}; - const childResult = {}; - for (const i of menuData) { - if (!routerData[i.path]) { - result[i.path] = i; - } - if (i.children) { - Object.assign(childResult, getBreadcrumbNameMap(i.children, routerData)); - } - } - return Object.assign({}, routerData, result, childResult); -}; +const getBreadcrumbNameMap = memoizeOne(meun => { + const routerMap = {}; + const mergeMeunAndRouter = meunData => { + meunData.forEach(meunItem => { + if (meunItem.children) { + mergeMeunAndRouter(meunItem.children); + } + // Reduce memory usage + routerMap[meunItem.path] = meunItem; + }); + }; + mergeMeunAndRouter(meun); + return routerMap; +}, deepEqual); const query = { 'screen-xs': { @@ -104,11 +104,17 @@ export default class BasicLayout extends React.PureComponent { isMobile, }; + constructor(props) { + super(props); + this.getPageTitle = memoizeOne(this.getPageTitle); + this.breadcrumbNameMap = getBreadcrumbNameMap(getMenuData()); + } + getChildContext() { - const { location, routerData } = this.props; + const { location } = this.props; return { location, - breadcrumbNameMap: getBreadcrumbNameMap(getMenuData(), routerData), + breadcrumbNameMap: this.breadcrumbNameMap, }; } @@ -128,23 +134,19 @@ export default class BasicLayout extends React.PureComponent { unenquireScreen(this.enquireHandler); } - getPageTitle() { - const { routerData, location } = this.props; - const { pathname } = location; - let title = 'Ant Design Pro'; + getPageTitle = pathname => { let currRouterData = null; // match params path - for (const key in routerData) { + Object.keys(this.breadcrumbNameMap).forEach(key => { if (pathToRegexp(key).test(pathname)) { - currRouterData = routerData[key]; - break; + currRouterData = this.breadcrumbNameMap[key]; } + }); + if (!currRouterData) { + return 'Ant Design Pro'; } - if (currRouterData && currRouterData.name) { - title = `${currRouterData.name} - Ant Design Pro`; - } - return title; - } + return `${currRouterData.name} - Ant Design Pro`; + }; getBaseRedirect = () => { // According to the url parameter to redirect @@ -212,12 +214,11 @@ export default class BasicLayout extends React.PureComponent { collapsed, fetchingNotices, notices, - routerData, - match, - location, + children, + location: { pathname }, } = this.props; const { isMobile: mb } = this.state; - const baseRedirect = this.getBaseRedirect(); + // const baseRedirect = this.getBaseRedirect(); const layout = ( - - - {redirectData.map(item => ( - - ))} - {getRoutes(match.path, routerData).map(item => ( - - ))} - - - - + {children}