import React from 'react'import PropTypes from 'prop-types'import { Switch, Route, Redirect, routerRedux } from 'dva/router'import dynamic from 'dva/dynamic'import App from 'routes/app'const { ConnectedRouter } = routerReduxconst Routers = function ({ history, app }) {const error = dynamic({app,component: () => import('./routes/error'),})const routes = [{path: '/dashboard',models: () => [import('./models/dashboard')],component: () => import('./routes/dashboard/'),},{path: '/organization',models: () => [import('./models/organization')],component: () => import('./routes/organization/'),},{path: '/module',models: () => [import('./models/module')],component: () => import('./routes/module/'),},{path: '/user',models: () => [import('./models/user')],component: () => import('./routes/user/'),},{path: '/login',models: () => [import('./models/login')],component: () => import('./routes/login/'),}]return (<ConnectedRouter history={history}><App><Switch><Route exact path="/" render={() => (<Redirect to="/dashboard" />)} />{routes.map(({ path, ...dynamics }, key) => (<Route key={key}exactpath={path}component={dynamic({app,...dynamics,})}/>))}<Route component={error} /></Switch></App></ConnectedRouter>)}Routers.propTypes = {history: PropTypes.object,app: PropTypes.object,}export default Routers
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。