You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
преди 3 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
  2. import Cookies from 'js-cookie'
  3. const routes: RouteRecordRaw[] = [
  4. {
  5. path: '/',
  6. name: 'Login',
  7. component: () => import('@/views/system/login/Login.vue'),
  8. },
  9. {
  10. path: '/layout/index',
  11. name: 'Layout',
  12. component: () => import('@/layout/index.vue'),
  13. redirect: '/views/home',
  14. children: [
  15. {
  16. path: '/views/home',
  17. name: 'home',
  18. meta: { title: '主页', isAuth: true }, //用户自定内容
  19. components: {
  20. key: () => import('@/views/system/home/Home.vue'),
  21. },
  22. },
  23. {
  24. path: '/views/system/menu',
  25. name: 'menu',
  26. meta: { title: '菜单模块', isAuth: true }, //用户自定内容
  27. components: {
  28. key: () => import('@/views/system/menu/index.vue'),
  29. },
  30. },
  31. {
  32. path: '/views/weixingrong/cardQueries',
  33. name: 'cardQueries',
  34. meta: { title: '卡片信息查询', isAuth: true }, //用户自定内容
  35. components: {
  36. key: () => import('@/views/weixingrong/cardQueries/cardQueries.vue'),
  37. },
  38. },
  39. {
  40. path: '/views/weixingrong/OBUQuery',
  41. name: 'OBUQuery',
  42. meta: { title: 'OBU信息查询', isAuth: true }, //用户自定内容
  43. components: {
  44. key: () => import('@/views/weixingrong/OBUQuery/OBUQuery.vue'),
  45. },
  46. },
  47. {
  48. path: '/views/weixingrong/signingQuery',
  49. name: 'signingQuery',
  50. meta: { title: '签约信息查询', isAuth: true }, //用户自定内容
  51. components: {
  52. key: () => import('@/views/weixingrong/signingQuery/signingQuery.vue'),
  53. },
  54. },
  55. {
  56. path: '/views/weixingrong/userQueryChange',
  57. name: 'userQueryChange',
  58. meta: { title: '用户信息查询', isAuth: true }, //用户自定内容
  59. components: {
  60. key: () => import('@/views/weixingrong/userQueryChange/userQueryChange.vue'),
  61. },
  62. },
  63. {
  64. path: '/views/weixingrong/vehicleEnquirChange',
  65. name: 'vehicleEnquirChange',
  66. meta: { title: '车辆信息查询', isAuth: true }, //用户自定内容
  67. components: {
  68. key: () => import('@/views/weixingrong/vehicleEnquirChange/vehicleEnquirChange.vue'),
  69. },
  70. },
  71. {
  72. path: '/views/fancongcong/advancepaymentaccount',
  73. name: 'advancepaymentaccount',
  74. meta: { title: '对公账户打款充值服务', isAuth: true }, //用户自定内容
  75. components: {
  76. key: () => import('@/views/fancongcong/advancepaymentaccount/advancepaymentaccount.vue'),
  77. },
  78. },
  79. {
  80. path: '/views/fancongcong/addsupplyCardBalance',
  81. name: 'addsupplyCardBalance',
  82. meta: { title: '储值卡-补交服务 ', isAuth: true }, //用户自定内容
  83. components: {
  84. key: () => import('@/views/fancongcong/addsupplyCardBalance/addsupplyCardBalance.vue'),
  85. },
  86. },
  87. {
  88. path: '/views/fancongcong/cardrechargefix',
  89. name: 'cardrechargefix',
  90. meta: { title: '储值卡充值修复服务(圈存修复服务)', isAuth: true }, //用户自定内容
  91. components: {
  92. key: () => import('@/views/fancongcong/cardrechargefix/cardrechargefix.vue'),
  93. },
  94. },
  95. {
  96. path: '/views/fancongcong/cardrefundcostManage',
  97. name: 'cardrefundcostManage ',
  98. meta: { title: '注销退费服务', isAuth: true }, //用户自定内容
  99. components: {
  100. key: () => import('@/views/fancongcong/cardrefundcostManage/cardrefundcostManage.vue'),
  101. },
  102. },
  103. {
  104. path: '/views/fancongcong/supplyCardBalance',
  105. name: 'supplyCardBalance',
  106. meta: { title: '储值卡-补卡额服务', isAuth: true }, //用户自定内容
  107. components: {
  108. key: () => import('@/views/fancongcong/supplyCardBalance/supplyCardBalance.vue'),
  109. },
  110. },
  111. {
  112. path: '/views/fancongcong/customerservice',
  113. name: 'customerservice',
  114. meta: { title: '储值卡充值服务(圈存)', isAuth: true }, //用户自定内容
  115. components: {
  116. key: () => import('@/views/fancongcong/customerservice/customerservice.vue'),
  117. },
  118. },
  119. {
  120. path: '/views/fancongcong/corporateaccountManage/corporateaccountManage',
  121. name: 'corporateaccountManage',
  122. meta: { title: '对公账户注册审核服务', isAuth: true }, //用户自定内容
  123. components: {
  124. key: () => import('@/views/fancongcong/corporateaccountManage/corporateaccountManage.vue'),
  125. },
  126. },
  127. {
  128. path: '/views/shengbo/blacklistQuery/blacklistQuery',
  129. name: 'blacklistQuery',
  130. meta: { title: '菜单模块', isAuth: true }, //黑名单查询服务
  131. components: {
  132. key: () => import('@/views/shengbo/blacklistQuery/blacklistQuery.vue'),
  133. },
  134. }, {
  135. path: '/views/shengbo/trafficFlow/trafficFlow',
  136. name: 'trafficFlow',
  137. meta: { title: '菜单模块', isAuth: true }, //通行流水查询服务
  138. components: {
  139. key: () => import('@/views/shengbo/trafficFlow/trafficFlow.vue'),
  140. },
  141. }, {
  142. path: '/views/dengmingcong/cardFillDo/cardFillDo',
  143. name: 'cardFillDo',
  144. meta: { title: '卡签补办', isAuth: true }, //卡签补办
  145. components: {
  146. key: () => import('@/views/dengmingcong/cardFillDo/cardFillDo.vue'),
  147. },
  148. }, {
  149. path: '/views/dengmingcong/cardRenewal/cardRenewal',
  150. name: 'cardRenewal',
  151. meta: { title: '卡签续期', isAuth: true }, //卡签续期
  152. components: {
  153. key: () => import('@/views/dengmingcong/cardRenewal/cardRenewal.vue'),
  154. },
  155. }, {
  156. path: '/views/dengmingcong/initiativeHangUp/initiativeHangUp',
  157. name: 'initiativeHangUp',
  158. meta: { title: '主动挂起服务', isAuth: true }, //主动挂起服务
  159. components: {
  160. key: () => import('@/views/dengmingcong/initiativeHangUp/initiativeHangUp.vue'),
  161. },
  162. }, {
  163. path: '/views/dengmingcong/passivityHangUp/passivityHangUp',
  164. name: 'passivityHangUp',
  165. meta: { title: '被动挂起服务', isAuth: true }, //被动挂起服务
  166. components: {
  167. key: () => import('@/views/dengmingcong/passivityHangUp/passivityHangUp.vue'),
  168. },
  169. }, {
  170. path: '/views/dengmingcong/TABActivate/TABActivate',
  171. name: 'TABActivate',
  172. meta: { title: '标签重新激活服务', isAuth: true }, //标签重新激活服务
  173. components: {
  174. key: () => import('@/views/dengmingcong/TABActivate/TABActivate.vue'),
  175. },
  176. }
  177. ],
  178. }
  179. ]
  180. const router = createRouter({
  181. history: createWebHashHistory(), //createWebHistory createWebHashHistory(带#号) 路由模式
  182. routes,
  183. })
  184. //新增前置路由首位
  185. router.beforeEach((to, from, next) => {
  186. if (to.meta.isAuth) { //是否需要验证权限
  187. if (Cookies.get('token')) {
  188. next() //继续往下
  189. } else {
  190. next({ name: 'Login' }); //没登录,跳转到login页
  191. }
  192. } else {
  193. next() //继续往下
  194. }
  195. })
  196. export default router