router.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. const data = [
  2. {
  3. path: '/',
  4. component: 'Layout',
  5. redirect: 'index',
  6. children: [
  7. {
  8. path: 'index',
  9. name: 'Index',
  10. component: '@/views/index/index',
  11. meta: {
  12. title: '首页',
  13. icon: 'home',
  14. affix: true,
  15. },
  16. },
  17. ],
  18. },
  19. {
  20. path: '/personnelManagement',
  21. component: 'Layout',
  22. redirect: 'noRedirect',
  23. name: 'PersonnelManagement',
  24. meta: { title: '人员', icon: 'users-cog', permissions: ['admin'] },
  25. children: [
  26. {
  27. path: 'userManagement',
  28. name: 'UserManagement',
  29. component: '@/views/personnelManagement/userManagement/index',
  30. meta: { title: '用户管理' },
  31. },
  32. {
  33. path: 'roleManagement',
  34. name: 'RoleManagement',
  35. component: '@/views/personnelManagement/roleManagement/index',
  36. meta: { title: '角色管理' },
  37. },
  38. {
  39. path: 'menuManagement',
  40. name: 'MenuManagement',
  41. component: '@/views/personnelManagement/menuManagement/index',
  42. meta: { title: '菜单管理', badge: 'New' },
  43. },
  44. ],
  45. },
  46. {
  47. path: '/vab',
  48. component: 'Layout',
  49. redirect: 'noRedirect',
  50. name: 'Vab',
  51. alwaysShow: true,
  52. meta: { title: '组件', icon: 'cloud' },
  53. children: [
  54. {
  55. path: 'permissions',
  56. name: 'Permission',
  57. component: '@/views/vab/permissions/index',
  58. meta: {
  59. title: '权限控制',
  60. permissions: ['admin', 'editor'],
  61. badge: 'New',
  62. },
  63. },
  64. {
  65. path: 'icon',
  66. component: 'EmptyLayout',
  67. redirect: 'noRedirect',
  68. name: 'Icon',
  69. meta: {
  70. title: '图标',
  71. permissions: ['admin'],
  72. },
  73. children: [
  74. {
  75. path: 'awesomeIcon',
  76. name: 'AwesomeIcon',
  77. component: '@/views/vab/icon/index',
  78. meta: { title: '常规图标' },
  79. },
  80. {
  81. path: 'colorfulIcon',
  82. name: 'ColorfulIcon',
  83. component: '@/views/vab/icon/colorfulIcon',
  84. meta: { title: '多彩图标' },
  85. },
  86. ],
  87. },
  88. {
  89. path: 'table',
  90. component: '@/views/vab/table/index',
  91. name: 'Table',
  92. meta: {
  93. title: '表格',
  94. permissions: ['admin'],
  95. },
  96. },
  97. {
  98. path: 'map',
  99. name: 'Map',
  100. component: '@/views/vab/map/index',
  101. meta: { title: '地图', permissions: ['admin'], badge: 'Pro' },
  102. },
  103. {
  104. path: 'webSocket',
  105. name: 'WebSocket',
  106. component: '@/views/vab/webSocket/index',
  107. meta: { title: 'webSocket', permissions: ['admin'] },
  108. },
  109. {
  110. path: 'form',
  111. name: 'Form',
  112. component: '@/views/vab/form/index',
  113. meta: { title: '表单', permissions: ['admin'] },
  114. },
  115. {
  116. path: 'element',
  117. name: 'Element',
  118. component: '@/views/vab/element/index',
  119. meta: { title: '常用组件', permissions: ['admin'] },
  120. },
  121. {
  122. path: 'tree',
  123. name: 'Tree',
  124. component: '@/views/vab/tree/index',
  125. meta: { title: '树', permissions: ['admin'] },
  126. },
  127. {
  128. path: 'verify',
  129. name: 'Verify',
  130. component: '@/views/vab/verify/index',
  131. meta: { title: '验证码', permissions: ['admin'] },
  132. },
  133. {
  134. path: 'menu1',
  135. component: '@/views/vab/nested/menu1/index',
  136. name: 'Menu1',
  137. alwaysShow: true,
  138. meta: {
  139. title: '嵌套路由 1',
  140. permissions: ['admin'],
  141. },
  142. children: [
  143. {
  144. path: 'menu1-1',
  145. name: 'Menu1-1',
  146. alwaysShow: true,
  147. meta: { title: '嵌套路由 1-1' },
  148. component: '@/views/vab/nested/menu1/menu1-1/index',
  149. children: [
  150. {
  151. path: 'menu1-1-1',
  152. name: 'Menu1-1-1',
  153. meta: { title: '嵌套路由 1-1-1' },
  154. component: '@/views/vab/nested/menu1/menu1-1/menu1-1-1/index',
  155. },
  156. ],
  157. },
  158. ],
  159. },
  160. {
  161. path: 'loading',
  162. name: 'Loading',
  163. component: '@/views/vab/loading/index',
  164. meta: { title: 'loading', permissions: ['admin'] },
  165. },
  166. {
  167. path: 'backToTop',
  168. name: 'BackToTop',
  169. component: '@/views/vab/backToTop/index',
  170. meta: { title: '返回顶部', permissions: ['admin'] },
  171. },
  172. {
  173. path: 'lodash',
  174. name: 'Lodash',
  175. component: '@/views/vab/lodash/index',
  176. meta: { title: 'lodash', permissions: ['admin'] },
  177. },
  178. {
  179. path: 'smallComponents',
  180. name: 'SmallComponents',
  181. component: '@/views/vab/smallComponents/index',
  182. meta: { title: '小组件', permissions: ['admin'] },
  183. },
  184. {
  185. path: 'upload',
  186. name: 'Upload',
  187. component: '@/views/vab/upload/index',
  188. meta: { title: '上传', permissions: ['admin'] },
  189. },
  190. {
  191. path: 'log',
  192. name: 'Log',
  193. component: '@/views/vab/errorLog/index',
  194. meta: { title: '错误日志模拟', permissions: ['admin'] },
  195. },
  196. {
  197. path: 'more',
  198. name: 'More',
  199. component: '@/views/vab/more/index',
  200. meta: { title: '关于', permissions: ['admin'] },
  201. },
  202. ],
  203. },
  204. {
  205. path: '/mall',
  206. component: 'Layout',
  207. redirect: 'noRedirect',
  208. name: 'Mall',
  209. meta: {
  210. title: '商城',
  211. icon: 'shopping-cart',
  212. permissions: ['admin'],
  213. },
  214. children: [
  215. {
  216. path: 'pay',
  217. name: 'Pay',
  218. component: '@/views/mall/pay/index',
  219. meta: {
  220. title: '支付',
  221. noKeepAlive: true,
  222. },
  223. children: null,
  224. },
  225. {
  226. path: 'goodsList',
  227. name: 'GoodsList',
  228. component: '@/views/mall/goodsList/index',
  229. meta: {
  230. title: '商品列表',
  231. },
  232. },
  233. ],
  234. },
  235. {
  236. path: '/error',
  237. component: 'EmptyLayout',
  238. redirect: 'noRedirect',
  239. name: 'Error',
  240. meta: { title: '错误页', icon: 'bug' },
  241. children: [
  242. {
  243. path: '401',
  244. name: 'Error401',
  245. component: '@/views/401',
  246. meta: { title: '401' },
  247. },
  248. {
  249. path: '404',
  250. name: 'Error404',
  251. component: '@/views/404',
  252. meta: { title: '404' },
  253. },
  254. ],
  255. },
  256. ]
  257. module.exports = [
  258. {
  259. url: '/menu/navigate',
  260. type: 'post',
  261. response() {
  262. return { code: 200, msg: 'success', data: data }
  263. },
  264. },
  265. ]