| | |
| | | const Design = asyncLoadComponent(() => import('@/views/design')) |
| | | const Login = asyncLoadComponent(() => import('@/views/login')) |
| | | const NotFound = asyncComponent(() => import('@/views/404')) |
| | | const MobManage = asyncLoadComponent(() => import('@/views/mobmanage')) |
| | | const AppManage = asyncLoadComponent(() => import('@/views/appmanage')) |
| | | const PCDesign = asyncLoadComponent(() => import('@/views/pcdesign')) |
| | | const MobDesign = asyncLoadComponent(() => import('@/views/mobdesign')) |
| | | const MenuDesign = asyncLoadComponent(() => import('@/views/menudesign')) |
| | | const BillPrint = asyncLoadComponent(() => import('@/views/billprint')) |
| | | const PrintT = asyncLoadComponent(() => import('@/views/printTemplate')) |
| | | const Interface = asyncLoadComponent(() => import('@/views/interface')) |
| | | |
| | | const routers = [ |
| | | {path: '/login', name: 'login', component: Login, auth: false}, |
| | |
| | | {path: '/ssologin/:param', name: 'ssologin', component: Sso, auth: false}, |
| | | {path: '/main', name: 'main', component: Main, auth: true}, |
| | | {path: '/design', name: 'design', component: Design, auth: true}, |
| | | {path: '/mobmanage', name: 'mobmanage', component: MobManage, auth: true}, |
| | | {path: '/mobdesign/:appId/:appType/:appCode/:appName', name: 'mobdesign', component: MobDesign, auth: true}, |
| | | {path: '/appmanage', name: 'appmanage', component: AppManage, auth: true}, |
| | | {path: '/pcdesign/:param', name: 'pcdesign', component: PCDesign, auth: true}, |
| | | {path: '/mobdesign/:param', name: 'mobdesign', component: MobDesign, auth: true}, |
| | | {path: '/menudesign/:param', name: 'menudesign', component: MenuDesign, auth: true}, |
| | | {path: '/billprint/:param', name: 'billprint', component: BillPrint, auth: true}, |
| | | {path: '/paramsmain/:param', name: 'pmain', component: Main, auth: true} |
| | | {path: '/paramsmain/:param', name: 'pmain', component: Main, auth: true}, |
| | | {path: '/interface', name: 'interface', component: Interface, auth: true} |
| | | ] |
| | | |
| | | export default class RouteConfig extends Component { |
| | |
| | | |
| | | if (_param.mainlogo) { |
| | | window.GLOB.mainlogo = _param.mainlogo |
| | | } |
| | | if (_param.navBar) { |
| | | window.GLOB.navBar = _param.navBar |
| | | } |
| | | if (_param.mstyle && styles[_param.mstyle]) { |
| | | document.body.className = styles[_param.mstyle] |
| | |
| | | return ( |
| | | <HashRouter> |
| | | <Switch> |
| | | { |
| | | routers.map((item, index) => { |
| | | return ( |
| | | <Route key={index} path={item.path} name={item.name} exact render={ props => { |
| | | return this.controlRoute(item, props) |
| | | }}/> |
| | | ) |
| | | }) |
| | | } |
| | | {routers.map((item, index) => { |
| | | return ( |
| | | <Route key={index} path={item.path} name={item.name} exact render={ props => this.controlRoute(item, props)}/> |
| | | ) |
| | | })} |
| | | <Redirect exact from="/" to="login"/> |
| | | <Route component= {NotFound}/> |
| | | </Switch> |