index.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /**
  5. * Note: sub-menu only appear when route children.length >= 1
  6. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  7. *
  8. * hidden: true if set true, item will not show in the sidebar(default is false)
  9. * alwaysShow: true if set true, will always show the root menu
  10. * if not set alwaysShow, when item has more than one children route,
  11. * it will becomes nested mode, otherwise not show the root menu
  12. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  13. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  14. * meta : {
  15. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  16. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  17. icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
  18. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  19. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  20. }
  21. */
  22. /**
  23. * constantRoutes
  24. * a base page that does not have permission requirements
  25. * all roles can be accessed
  26. */
  27. export const constantRoutes = [{
  28. path: '/404',
  29. component: () =>
  30. import ('@/views/404'),
  31. hidden: true
  32. },
  33. {
  34. path: '/login',
  35. component: () =>
  36. import ('@/views/login'),
  37. hidden: true
  38. },
  39. {
  40. path: '/',
  41. redirect: '/EnterSys',
  42. hidden: true
  43. },
  44. {
  45. path: '/EnterSys',
  46. component: () =>
  47. import ('@/views/index.vue')
  48. },
  49. {
  50. path: '/people_manage',
  51. component: () =>
  52. import ('@/views/people_manage/index.vue')
  53. },
  54. {
  55. path: '/createPerson',
  56. component: () =>
  57. import ('@/views/people_manage/CreatePerson.vue')
  58. },
  59. {
  60. path: '/organize_manage',
  61. component: () =>
  62. import ('@/views/organize_manage/index.vue')
  63. },
  64. {
  65. path: '/createOrganize',
  66. component: () =>
  67. import ('@/views/organize_manage/CreateOrganize.vue')
  68. },
  69. {
  70. path: '/peopleList',
  71. component: () =>
  72. import ('@/views/organize_manage/PersonList.vue')
  73. },
  74. {
  75. path: '/recorded_course',
  76. component: () =>
  77. import ('@/views/content_manage/course_manage/RecordedCourse.vue')
  78. },
  79. {
  80. path: '/live_course',
  81. component: () =>
  82. import ('@/views/content_manage/course_manage/LiveCourse.vue')
  83. },
  84. {
  85. path: '/createLive',
  86. component: () =>
  87. import ('@/views/content_manage/course_manage/CreateLive.vue')
  88. },
  89. {
  90. path: '/createRecorded',
  91. component: () =>
  92. import ('@/views/content_manage/course_manage/CreateRecorded.vue')
  93. },
  94. {
  95. path: '/newspaper_manage',
  96. component: () =>
  97. import ('@/views/content_manage/newspaper_manage/index.vue')
  98. },
  99. {
  100. path: '/createNewspaper',
  101. component: () =>
  102. import ('@/views/content_manage/newspaper_manage/CreateNewspaper.vue')
  103. },
  104. {
  105. path: '/editPerson',
  106. component: () =>
  107. import ('@/views/people_manage/EditPerson.vue')
  108. },
  109. {
  110. path: '/editOrgPerson',
  111. component: () =>
  112. import ('@/views/organize_manage/EditPerson.vue')
  113. },
  114. {
  115. path: '/email_setting',
  116. component: () =>
  117. import ('@/views/system_config/EmailSetting.vue')
  118. },
  119. {
  120. path: '/export_setting',
  121. component: () =>
  122. import ('@/views/system_config/ExportSetting.vue')
  123. },
  124. {
  125. path: '/discount_setting',
  126. component: () =>
  127. import ('@/views/system_config/DiscountRuleSetting.vue')
  128. },
  129. {
  130. path: '/share_setting',
  131. component: () =>
  132. import ('@/views/system_config/ShareSetting.vue')
  133. },
  134. {
  135. path: '/pay_setting',
  136. component: () =>
  137. import ('@/views/system_config/PaySetting.vue')
  138. },
  139. {
  140. path: '/personal',
  141. component: () =>
  142. import ('@/views/personal.vue')
  143. },
  144. {
  145. path: '/channelList',
  146. component: () =>
  147. import ('@/views/content_manage/newspaper_manage/ChannelList.vue')
  148. },
  149. {
  150. path: '/checkCourse',
  151. component: () =>
  152. import ('@/views/content_manage/course_manage/CheckLBCourse.vue')
  153. },
  154. {
  155. path: '/createArticle',
  156. component: () =>
  157. import ('@/views/content_manage/newspaper_manage/CreateArticle.vue')
  158. },
  159. {
  160. path: '/flow_manage',
  161. component: () =>
  162. import ('@/views/finance_manage/FlowManage.vue')
  163. },
  164. // 404 page must be placed at the end !!!
  165. { path: '*', redirect: '/', hidden: true }
  166. ]
  167. const createRouter = () =>
  168. new Router({
  169. // mode: 'history', // require service support
  170. scrollBehavior: () => ({ y: 0 }),
  171. routes: constantRoutes
  172. })
  173. const router = createRouter()
  174. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  175. export function resetRouter() {
  176. const newRouter = createRouter()
  177. router.matcher = newRouter.matcher // reset router
  178. }
  179. export default router