| | |
| | | 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: '/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 { |
| | |
| | | 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> |