index.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. import Layout from '@/components/Layout.vue'
  3. const routes = [
  4. {
  5. path: '/login',
  6. name: 'Login',
  7. component: () => import('@/views/Login.vue'),
  8. meta: { public: true }
  9. },
  10. {
  11. path: '/',
  12. component: Layout,
  13. redirect: '/customization/hsbc/equity-products',
  14. children: [
  15. {
  16. path: 'customization/hsbc/pages',
  17. redirect: 'customization/hsbc/pages/home',
  18. meta: { title: '页面管理' }
  19. },
  20. {
  21. path: 'customization/hsbc/pages/home',
  22. name: 'PageHomeConfig',
  23. component: () => import('@/views/PageHomeConfig.vue'),
  24. meta: { title: '权益介绍页' }
  25. },
  26. {
  27. path: 'customization/hsbc/pages/zone',
  28. name: 'PageZoneConfig',
  29. component: () => import('@/views/PageZoneConfig.vue'),
  30. meta: { title: '权益首页' }
  31. },
  32. {
  33. path: 'customization/hsbc/pages/assembly',
  34. name: 'PageAssembly',
  35. component: () => import('@/views/PageAssembly.vue'),
  36. meta: { title: '组装页' }
  37. },
  38. {
  39. path: 'customization/hsbc/equity-products',
  40. name: 'EquityProducts',
  41. component: () => import('@/views/EquityProducts.vue'),
  42. meta: { title: '借记卡权益' }
  43. },
  44. {
  45. path: 'customization/hsbc/credit-card-equity',
  46. name: 'CreditCardEquity',
  47. component: () => import('@/views/CreditCardEquity.vue'),
  48. meta: { title: '信用卡权益' }
  49. },
  50. {
  51. path: 'customization/hsbc/crowd-tasks',
  52. name: 'CrowdTaskList',
  53. component: () => import('@/views/CrowdTaskList.vue'),
  54. meta: { title: '客群任务管理' }
  55. },
  56. {
  57. path: 'customization/hsbc/crowd-tasks/add',
  58. name: 'CrowdTaskAdd',
  59. component: () => import('@/views/CrowdTaskEdit.vue'),
  60. meta: { title: '新建客群任务' }
  61. },
  62. {
  63. path: 'customization/hsbc/crowd-tasks/edit/:id',
  64. name: 'CrowdTaskEdit',
  65. component: () => import('@/views/CrowdTaskEdit.vue'),
  66. meta: { title: '编辑客群任务' }
  67. },
  68. {
  69. path: 'customization/hsbc/crowd-tasks/copy/:id',
  70. name: 'CrowdTaskCopy',
  71. component: () => import('@/views/CrowdTaskEdit.vue'),
  72. meta: { title: '复制客群任务' }
  73. },
  74. {
  75. path: 'customization/hsbc/crowd-tasks/view/:id',
  76. name: 'CrowdTaskView',
  77. component: () => import('@/views/CrowdTaskView.vue'),
  78. meta: { title: '客群任务详情' }
  79. },
  80. {
  81. path: 'customization/hsbc/crowd-name-lists/add',
  82. name: 'CrowdNameListAdd',
  83. component: () => import('@/views/CrowdNameListEdit.vue'),
  84. meta: { title: '新增指定客户号客群' }
  85. },
  86. {
  87. path: 'customization/hsbc/crowd-name-lists/edit/:id',
  88. name: 'CrowdNameListEdit',
  89. component: () => import('@/views/CrowdNameListEdit.vue'),
  90. meta: { title: '编辑指定客户号客群' }
  91. },
  92. {
  93. path: 'customization/hsbc/rule-groups',
  94. name: 'RuleGroupList',
  95. component: () => import('@/views/RuleGroupList.vue'),
  96. meta: { title: '规则组管理' }
  97. },
  98. {
  99. path: 'customization/hsbc/rule-groups/add',
  100. name: 'RuleGroupAdd',
  101. component: () => import('@/views/RuleGroupEdit.vue'),
  102. meta: { title: '新增规则组' }
  103. },
  104. {
  105. path: 'customization/hsbc/rule-groups/edit/:id',
  106. name: 'RuleGroupEdit',
  107. component: () => import('@/views/RuleGroupEdit.vue'),
  108. meta: { title: '编辑规则组' }
  109. },
  110. {
  111. path: 'customization/hsbc/rule-groups/view/:id',
  112. name: 'RuleGroupView',
  113. component: () => import('@/views/RuleGroupView.vue'),
  114. meta: { title: '规则组详情' }
  115. },
  116. {
  117. path: 'customization/hsbc/rule-group-audit',
  118. name: 'RuleGroupAuditList',
  119. component: () => import('@/views/RuleGroupAuditList.vue'),
  120. meta: { title: '规则组审核' }
  121. },
  122. {
  123. path: 'customization/hsbc/rule-group-audit/:id',
  124. name: 'RuleGroupAuditDetail',
  125. component: () => import('@/views/RuleGroupAuditDetail.vue'),
  126. meta: { title: '规则组审核详情' }
  127. },
  128. {
  129. path: 'customization/hsbc/equity-products/add',
  130. name: 'AddEquityProduct',
  131. component: () => import('@/views/AddEquityProduct.vue'),
  132. meta: { title: '添加权益' }
  133. },
  134. {
  135. path: 'customization/hsbc/equity-products/view/:id',
  136. name: 'ViewEquityProduct',
  137. component: () => import('@/views/ViewEquityProduct.vue'),
  138. meta: { title: '查看权益' }
  139. },
  140. {
  141. path: 'customization/hsbc/equity-products/edit/:id',
  142. name: 'EditEquityProduct',
  143. component: () => import('@/views/EditEquityProduct.vue'),
  144. meta: { title: '编辑权益' }
  145. },
  146. {
  147. path: 'customization/hsbc/equity-products/audit/:id',
  148. name: 'AuditEquityProduct',
  149. component: () => import('@/views/AuditEquityProduct.vue'),
  150. meta: { title: '审核权益' }
  151. },
  152. {
  153. path: 'customization/hsbc/equity-products/coupons/:id',
  154. name: 'EquityProductCoupons',
  155. component: () => import('@/views/EquityProductCoupons.vue'),
  156. meta: { title: '券码管理' }
  157. },
  158. {
  159. path: 'customization/hsbc/tags',
  160. name: 'TagList',
  161. component: () => import('@/views/TagList.vue'),
  162. meta: { title: '标签管理' }
  163. },
  164. {
  165. path: 'customization/hsbc/tags/add',
  166. name: 'TagAdd',
  167. component: () => import('@/views/TagEdit.vue'),
  168. meta: { title: '新建标签' }
  169. },
  170. {
  171. path: 'customization/hsbc/tags/edit/:id',
  172. name: 'TagEdit',
  173. component: () => import('@/views/TagEdit.vue'),
  174. meta: { title: '编辑标签' }
  175. },
  176. {
  177. path: 'customization/hsbc/tags/view/:id',
  178. name: 'TagView',
  179. component: () => import('@/views/TagView.vue'),
  180. meta: { title: '查看标签' }
  181. },
  182. {
  183. path: 'customization/hsbc/sms-templates',
  184. name: 'SmsTemplateList',
  185. component: () => import('@/views/SmsTemplateList.vue'),
  186. meta: { title: '短信模板管理' }
  187. },
  188. {
  189. path: 'customization/hsbc/sms-send-records',
  190. name: 'SmsSendRecord',
  191. component: () => import('@/views/SmsSendRecord.vue'),
  192. meta: { title: '发送记录查询' }
  193. },
  194. {
  195. path: 'customization/hsbc/equity-grant',
  196. name: 'CustomerEquityGrant',
  197. component: () => import('@/views/CustomerEquityGrant.vue'),
  198. meta: { title: '客户权益发放' }
  199. },
  200. {
  201. path: 'customization/hsbc/cash-discount-grant',
  202. name: 'CashDiscountGrant',
  203. component: () => import('@/views/CashDiscountGrant.vue'),
  204. meta: { title: '立减金发放明细' }
  205. },
  206. {
  207. path: 'customization/hsbc/points-detail',
  208. name: 'PointsDetail',
  209. component: () => import('@/views/PointsDetail.vue'),
  210. meta: { title: '积分明细查询' }
  211. },
  212. {
  213. path: 'customization/hsbc/channel',
  214. name: 'ChannelManagement',
  215. component: () => import('@/views/ChannelManagement.vue'),
  216. meta: { title: 'Channel管理' }
  217. },
  218. {
  219. path: 'customization/hsbc/campaign',
  220. name: 'CampaignManagement',
  221. component: () => import('@/views/CampaignManagement.vue'),
  222. meta: { title: 'Campaign管理' }
  223. },
  224. {
  225. path: 'customization/hsbc/audit',
  226. name: 'AuditList',
  227. component: () => import('@/views/AuditList.vue'),
  228. meta: { title: '权益审核' }
  229. },
  230. {
  231. path: 'customization/hsbc/audit/:id',
  232. name: 'AuditDetail',
  233. component: () => import('@/views/AuditDetail.vue'),
  234. meta: { title: '审核详情' }
  235. },
  236. {
  237. path: 'customization/hsbc/equity-grant-campaign',
  238. name: 'EquityGrantCampaign',
  239. component: () => import('@/views/EquityGrantCampaign.vue'),
  240. meta: { title: '发放计划' }
  241. },
  242. {
  243. path: 'customization/hsbc/equity-grant-campaign/add',
  244. name: 'EquityGrantCampaignAdd',
  245. component: () => import('@/views/EquityGrantCampaignEdit.vue'),
  246. meta: { title: '新建发放计划' }
  247. },
  248. {
  249. path: 'customization/hsbc/equity-grant-campaign/edit/:id',
  250. name: 'EquityGrantCampaignEdit',
  251. component: () => import('@/views/EquityGrantCampaignEdit.vue'),
  252. meta: { title: '编辑发放计划' }
  253. },
  254. {
  255. path: 'customization/hsbc/equity-grant-campaign/copy/:id',
  256. name: 'EquityGrantCampaignCopy',
  257. component: () => import('@/views/EquityGrantCampaignEdit.vue'),
  258. meta: { title: '复制发放计划' }
  259. },
  260. {
  261. path: 'customization/hsbc/equity-grant-campaign/view/:id',
  262. name: 'EquityGrantCampaignView',
  263. component: () => import('@/views/EquityGrantCampaignView.vue'),
  264. meta: { title: '查看发放计划' }
  265. },
  266. {
  267. path: 'customization/hsbc/campaign-audit',
  268. name: 'CampaignAuditList',
  269. component: () => import('@/views/CampaignAuditList.vue'),
  270. meta: { title: '发放计划审核' }
  271. },
  272. {
  273. path: 'customization/hsbc/campaign-audit/:id',
  274. name: 'CampaignAuditDetail',
  275. component: () => import('@/views/CampaignAuditDetail.vue'),
  276. meta: { title: '发放计划审核详情' }
  277. }
  278. ]
  279. },
  280. { path: '/:pathMatch(.*)*', redirect: '/' }
  281. ]
  282. const router = createRouter({
  283. history: createWebHashHistory(),
  284. routes
  285. })
  286. router.beforeEach((to, from, next) => {
  287. const token = localStorage.getItem('token')
  288. if (to.meta && to.meta.public) {
  289. if (token && to.path === '/login') return next('/')
  290. return next()
  291. }
  292. if (!token) {
  293. return next({ path: '/login', query: { redirect: to.fullPath } })
  294. }
  295. next()
  296. })
  297. export default router