index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. const Index = () => import('@/pages/index');
  4. const Login = () => import('@/pages/login');
  5. const order = () => import('@/pages/subPages/order');
  6. // 柜体控制
  7. // const Express = () => import('@/pages/subPages/express');
  8. const balance = () => import('@/pages/subPages/balance');
  9. const Message = () => import('@/pages/subPages/message');
  10. // const Status = () => import('@/pages/subPages/status');
  11. const View = () => import('@/pages/subPages/view');
  12. Vue.use(VueRouter)
  13. const routes = [
  14. {
  15. path: '/',
  16. name: 'Index',
  17. component: Index,
  18. // redirect:'/express',
  19. children:[
  20. // 订单统计
  21. {
  22. path:'/order',
  23. name:'order',
  24. component:order
  25. },
  26. // 余额充值
  27. {
  28. path:'/balance',
  29. name:'balance',
  30. component:balance
  31. },
  32. // 实时动账
  33. {
  34. path:'/message',
  35. name:'message',
  36. component:Message
  37. },
  38. // {
  39. // path:'/status',
  40. // name:'status',
  41. // component:Status
  42. // },
  43. // 安全IP控制
  44. {
  45. path:'/view',
  46. name:'view',
  47. component:View
  48. }
  49. ]
  50. },
  51. {
  52. path: '/login',
  53. name: 'Login',
  54. component: Login
  55. }
  56. ]
  57. const router = new VueRouter({
  58. routes
  59. })
  60. router.beforeEach((to,from,next)=>{
  61. next();
  62. });
  63. export default router