article.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const contentTypeMap = [
  2. // 'content',
  3. 'yyszb',
  4. 'entservice',
  5. 'bdprivate',
  6. 'mailprivate',
  7. 'bdcontent',
  8. 'indexcontent',
  9. 'advancedProject'
  10. ]
  11. function createArticleAlias(typeList = []) {
  12. const list = []
  13. typeList.forEach((type) => {
  14. list.push(`/article/${type}/:id`)
  15. list.push(`/article/${type}/:id.html`)
  16. list.push(`/jyapp/article/${type}/:id`)
  17. list.push(`/jyapp/article/${type}/:id.html`)
  18. })
  19. return list
  20. }
  21. const articleAliasList = createArticleAlias(contentTypeMap)
  22. export default [
  23. {
  24. path: '/content/:id*.html',
  25. name: 'article-content',
  26. alias: [
  27. '/article/content/:id',
  28. '/nologin/content/:id',
  29. '/jyapp/article/content/:id.html',
  30. '/jyapp/nologin/content/:id.html',
  31. // 配置详情页其他别名
  32. ...articleAliasList
  33. ],
  34. component: () => import('@/views/article/content.vue'),
  35. meta: {
  36. header: true,
  37. title: '公告信息'
  38. }
  39. },
  40. {
  41. path: '/issued/:id',
  42. name: 'issued-content',
  43. component: () => import('@/views/article/index.vue'),
  44. meta: {
  45. header: true,
  46. title: '供应信息'
  47. }
  48. }
  49. ]