menu.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // import request from '@/utils/request'
  2. // 獲取路由 - 現在使用靜態配置,不再從後端獲取
  3. export const getRouters = () => {
  4. return Promise.resolve({
  5. data: [
  6. {
  7. path: '/user',
  8. component: 'Layout',
  9. redirect: '/user/myuser',
  10. meta: {
  11. icon:"peoples",
  12. link: null,
  13. noCache: false,
  14. title:"我的會員",
  15. },
  16. children: [
  17. {
  18. path: 'myuser',
  19. component: 'agent/myuser',
  20. name: 'myuser',
  21. meta: {title: '我的會員', icon: 'user', affix: true},
  22. children: []
  23. },
  24. {
  25. path: 'income',
  26. component: 'agent/income',
  27. name: 'income',
  28. meta: {title: '我的收益', icon: 'money', affix: false},
  29. children: []
  30. }
  31. ]
  32. },
  33. {
  34. path:"/authUp",
  35. component: "Layout",
  36. redirect: "noRedirect",
  37. alwaysShow: true,
  38. meta:{
  39. icon:"upload",
  40. link: null,
  41. noCache: false,
  42. title:"會員授權上傳",
  43. },
  44. children: [
  45. {
  46. path: 'authUp/userContact',
  47. component: 'agent/userContact',
  48. name: 'userContact',
  49. meta: {title: '會員聯絡人', icon: 'people', affix: false},
  50. children: []
  51. },
  52. {
  53. path: 'authUp/position',
  54. component: 'agent/position',
  55. name: 'position',
  56. meta: {title: '會員定位資訊', icon: 'monitor', affix: false},
  57. children: []
  58. },
  59. {
  60. path: 'authUp/image',
  61. component: 'agent/image',
  62. name: 'image',
  63. meta: {title: '會員圖片', icon: 'eye', affix: false},
  64. children: []
  65. },
  66. {
  67. path: 'authUp/call',
  68. component: 'agent/call',
  69. name: 'call',
  70. meta: {title: '通話記錄', icon: 'phone', affix: false},
  71. children: []
  72. },
  73. {
  74. path: 'authUp/sms',
  75. component: 'agent/sms',
  76. name: 'sms',
  77. meta: {title: '簡訊記錄', icon: 'message', affix: false},
  78. children: []
  79. },
  80. ]
  81. }
  82. ]
  83. })
  84. }
  85. /*
  86. 菜單配置說明:
  87. - path: 路由路徑
  88. - component: 組件路徑(對應 views 目錄下的 .vue 文件)
  89. - name: 路由名稱
  90. - redirect: 重定向路徑
  91. - meta: 元資訊
  92. - title: 菜單標題
  93. - icon: 圖標名稱(對應 src/icons/svg 目錄下的圖標)
  94. - roles: 權限角色(可選)
  95. 如何添加新菜單:
  96. 1. 在 views 目錄下創建對應的 .vue 文件
  97. 2. 在 children 數組中添加新的菜單項
  98. 3. component 路徑要匹配 views 目錄下的文件路徑
  99. 示例:添加一個新的 "個人中心" 菜單
  100. {
  101. path: 'profile',
  102. component: 'system/user/profile/index',
  103. name: 'Profile',
  104. meta: { title: '個人中心', icon: 'user' },
  105. children: []
  106. }
  107. */