index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import ElementUI from 'element-ui'
  4. import 'element-ui/lib/theme-chalk/index.css'
  5. import home from '@/components/pages/home'
  6. import curriculum from '@/components/pages/curriculum'
  7. import notice from '@/components/pages/notice'
  8. import tutor from '@/components/pages/tutor'
  9. import grouping from '@/components/pages/grouping'
  10. import organization from '@/components/pages/organization'
  11. import jurisdiction from '@/components/pages/jurisdiction'
  12. import login from '@/components/login'
  13. import course from '@/components/pages/courseDetail'
  14. import userManage from '@/components/pages/userManage'
  15. import works from '@/components/pages/works'
  16. import classA from '@/components/pages/class'
  17. // import template from '@/components/pages/template'
  18. import template from '@/components/pages/courseTemplate'
  19. Vue.use(Router).use(ElementUI)
  20. export default new Router({
  21. routes: [
  22. {
  23. path: '/',
  24. name: 'home',
  25. component: home,
  26. meta: {
  27. requireAuth: true
  28. }
  29. },
  30. {
  31. path: '/curriculum',
  32. name: 'curriculum',
  33. component: curriculum,
  34. meta: {
  35. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  36. }
  37. },
  38. {
  39. path: '/template',
  40. name: 'template',
  41. component: template,
  42. meta: {
  43. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  44. }
  45. },
  46. {
  47. path: '/course',
  48. name: 'course',
  49. component: course,
  50. meta: {
  51. }
  52. },
  53. {
  54. path: '/notice',
  55. name: 'notice',
  56. component: notice,
  57. meta: {
  58. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  59. }
  60. },
  61. {
  62. path: '/find',
  63. name: 'find',
  64. component: () => import('@/components/pages/find'),
  65. meta: {
  66. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  67. }
  68. },
  69. {
  70. path: '/tutor',
  71. name: 'tutor',
  72. component: tutor,
  73. meta: {
  74. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  75. }
  76. },
  77. {
  78. path: '/grouping',
  79. name: 'grouping',
  80. component: grouping,
  81. meta: {
  82. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  83. }
  84. },
  85. {
  86. path: '/organization',
  87. name: 'organization',
  88. component: organization,
  89. meta: {
  90. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  91. }
  92. },
  93. {
  94. path: '/jurisdiction',
  95. name: 'jurisdiction',
  96. component: jurisdiction,
  97. meta: {
  98. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  99. }
  100. },
  101. {
  102. path: '/userManage',
  103. name: 'userManage',
  104. component: userManage,
  105. meta: {
  106. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  107. }
  108. },
  109. {
  110. path: '/works',
  111. name: 'works',
  112. component: works,
  113. meta: {
  114. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  115. }
  116. },
  117. {
  118. path: '/class',
  119. name: 'class',
  120. component: classA,
  121. meta: {
  122. requireAuth: true // 是否需要判断是否登录,这里是需要判断
  123. }
  124. },
  125. {
  126. path: '/login',
  127. name: 'login',
  128. component: login,
  129. meta: {
  130. requireAuth: '' // 不需要鉴权
  131. }
  132. }
  133. ]
  134. })