index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. // import vantui from 'vant'
  4. // import 'vant/lib/index.css'
  5. import home from '@/components/pages/home.vue'
  6. import learning from '@/components/pages/learning'
  7. import my from '@/components/pages/my.vue'
  8. import find from '@/components/pages/find.vue'
  9. Vue.use(Router)
  10. export default new Router({
  11. routes: [
  12. {
  13. path: '/',
  14. name: 'Home',
  15. component: home,
  16. meta: {
  17. title: '家校社',
  18. requireAuth: '' // 是否需要判断是否登录,这里是需要判断
  19. }
  20. },
  21. {
  22. path: '/learning',
  23. name: 'learning',
  24. component: learning,
  25. meta: {
  26. title: '五育融合',
  27. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  28. }
  29. },
  30. {
  31. path: '/my',
  32. name: 'my',
  33. component: my,
  34. meta: {
  35. title: '我的',
  36. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  37. }
  38. },
  39. {
  40. path: '/find',
  41. name: 'find',
  42. component: find,
  43. meta: {
  44. title: '创新',
  45. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  46. }
  47. },
  48. {
  49. path: '/Login',
  50. name: 'login',
  51. component: () => import('@/components/login'),
  52. meta: {
  53. title: '登录',
  54. }
  55. },
  56. {
  57. path: '/workDetail',
  58. name: 'workDetail',
  59. component: () => import('@/components/pages/workDetail'),
  60. meta: {
  61. title: '作业详情',
  62. }
  63. },
  64. {
  65. path: '/submitWork',
  66. name: 'submitWork',
  67. component: () => import('@/components/pages/submitWork'),
  68. meta: {
  69. title: '提交作业',
  70. }
  71. },
  72. {
  73. path: '/examine',
  74. name: 'examine',
  75. component: () => import('@/components/pages/examine'),
  76. meta: {
  77. title: '义工团审核',
  78. }
  79. },
  80. {
  81. path: '/myDetail',
  82. name: 'myDetail',
  83. component: () => import('@/components/pages/myDetail'),
  84. meta: {
  85. title: '个人资料',
  86. }
  87. },
  88. {
  89. path: '/examineWork',
  90. name: 'examineWork',
  91. component: () => import('@/components/pages/examineWork'),
  92. meta: {
  93. title: '义工任务审核',
  94. }
  95. },
  96. {
  97. path: '/release',
  98. name: 'release',
  99. component: () => import('@/components/pages/release'),
  100. meta: {
  101. title: '发布内容',
  102. }
  103. },
  104. {
  105. path: '/findDetail',
  106. name: 'findDetail',
  107. component: () => import('@/components/pages/findDetail'),
  108. meta: {
  109. title: '创新',
  110. }
  111. },
  112. {
  113. path: '/myWorkDetail',
  114. name: 'myWorkDetail',
  115. component: () => import('@/components/pages/myWorkDetail'),
  116. meta: {
  117. title: '详情',
  118. }
  119. }
  120. ,
  121. {
  122. path: '/learningDetail',
  123. name: 'learningDetail',
  124. component: () => import('@/components/pages/learningDetail'),
  125. meta: {
  126. title: '详情',
  127. }
  128. }
  129. ]
  130. })
  131. const VueRouterPush = Router.prototype.push
  132. Router.prototype.push = function push(to) {
  133. return VueRouterPush.call(this, to).catch(err => err)
  134. }