router.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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: "remixIcon",
  82. name: "RemixIcon",
  83. component: "@/views/vab/icon/remixIcon",
  84. meta: { title: "小清新图标" },
  85. },
  86. {
  87. path: "colorfulIcon",
  88. name: "ColorfulIcon",
  89. component: "@/views/vab/icon/colorfulIcon",
  90. meta: { title: "多彩图标" },
  91. },
  92. ],
  93. },
  94. {
  95. path: "table",
  96. component: "@/views/vab/table/index",
  97. name: "Table",
  98. meta: {
  99. title: "表格",
  100. permissions: ["admin"],
  101. },
  102. },
  103. {
  104. path: "map",
  105. name: "Map",
  106. component: "@/views/vab/map/index",
  107. meta: { title: "地图", permissions: ["admin"], badge: "Pro" },
  108. },
  109. {
  110. path: "webSocket",
  111. name: "WebSocket",
  112. component: "@/views/vab/webSocket/index",
  113. meta: { title: "webSocket", permissions: ["admin"] },
  114. },
  115. {
  116. path: "form",
  117. name: "Form",
  118. component: "@/views/vab/form/index",
  119. meta: { title: "表单", permissions: ["admin"] },
  120. },
  121. {
  122. path: "element",
  123. name: "Element",
  124. component: "@/views/vab/element/index",
  125. meta: { title: "常用组件", permissions: ["admin"] },
  126. },
  127. {
  128. path: "tree",
  129. name: "Tree",
  130. component: "@/views/vab/tree/index",
  131. meta: { title: "树", permissions: ["admin"] },
  132. },
  133. {
  134. path: "card",
  135. name: "Card",
  136. component: "@/views/vab/card/index",
  137. meta: { title: "卡片", permissions: ["admin"] },
  138. },
  139. {
  140. path: "verify",
  141. name: "Verify",
  142. component: "@/views/vab/verify/index",
  143. meta: { title: "验证码", permissions: ["admin"] },
  144. },
  145. {
  146. path: "menu1",
  147. component: "@/views/vab/nested/menu1/index",
  148. name: "Menu1",
  149. alwaysShow: true,
  150. meta: {
  151. title: "嵌套路由 1",
  152. permissions: ["admin"],
  153. },
  154. children: [
  155. {
  156. path: "menu1-1",
  157. name: "Menu1-1",
  158. alwaysShow: true,
  159. meta: { title: "嵌套路由 1-1" },
  160. component: "@/views/vab/nested/menu1/menu1-1/index",
  161. children: [
  162. {
  163. path: "menu1-1-1",
  164. name: "Menu1-1-1",
  165. meta: { title: "嵌套路由 1-1-1" },
  166. component: "@/views/vab/nested/menu1/menu1-1/menu1-1-1/index",
  167. },
  168. ],
  169. },
  170. ],
  171. },
  172. {
  173. path: "magnifier",
  174. name: "Magnifier",
  175. component: "@/views/vab/magnifier/index",
  176. meta: { title: "放大镜", permissions: ["admin"] },
  177. },
  178. {
  179. path: "echarts",
  180. name: "Echarts",
  181. component: "@/views/vab/echarts/index",
  182. meta: { title: "图表", permissions: ["admin"] },
  183. },
  184. {
  185. path: "loading",
  186. name: "Loading",
  187. component: "@/views/vab/loading/index",
  188. meta: { title: "loading", permissions: ["admin"] },
  189. },
  190. {
  191. path: "player",
  192. name: "Player",
  193. component: "@/views/vab/player/index",
  194. meta: { title: "视频播放器", permissions: ["admin"] },
  195. },
  196. {
  197. path: "markdownEditor",
  198. name: "MarkdownEditor",
  199. component: "@/views/vab/markdownEditor/index",
  200. meta: { title: "markdown编辑器", permissions: ["admin"] },
  201. },
  202. {
  203. path: "editor",
  204. name: "Editor",
  205. component: "@/views/vab/editor/index",
  206. meta: { title: "富文本编辑器", permissions: ["admin"], badge: "New" },
  207. },
  208. {
  209. path: "backToTop",
  210. name: "BackToTop",
  211. component: "@/views/vab/backToTop/index",
  212. meta: { title: "返回顶部", permissions: ["admin"] },
  213. },
  214. {
  215. path: "lodash",
  216. name: "Lodash",
  217. component: "@/views/vab/lodash/index",
  218. meta: { title: "lodash", permissions: ["admin"] },
  219. },
  220. {
  221. path: "imgComparison",
  222. name: "ImgComparison",
  223. component: "@/views/vab/imgComparison/index",
  224. meta: { title: "图像拖拽比对", permissions: ["admin"] },
  225. },
  226. {
  227. path: "smallComponents",
  228. name: "SmallComponents",
  229. component: "@/views/vab/smallComponents/index",
  230. meta: { title: "小组件", permissions: ["admin"] },
  231. },
  232. {
  233. path: "upload",
  234. name: "Upload",
  235. component: "@/views/vab/upload/index",
  236. meta: { title: "上传", permissions: ["admin"] },
  237. },
  238. {
  239. path: "log",
  240. name: "Log",
  241. component: "@/views/vab/errorLog/index",
  242. meta: { title: "错误日志模拟", permissions: ["admin"] },
  243. },
  244. {
  245. path: "more",
  246. name: "More",
  247. component: "@/views/vab/more/index",
  248. meta: { title: "关于", permissions: ["admin"] },
  249. },
  250. ],
  251. },
  252. {
  253. path: "/mall",
  254. component: "Layout",
  255. redirect: "noRedirect",
  256. name: "Mall",
  257. meta: {
  258. title: "商城",
  259. icon: "shopping-cart",
  260. permissions: ["admin"],
  261. },
  262. children: [
  263. {
  264. path: "pay",
  265. name: "Pay",
  266. component: "@/views/mall/pay/index",
  267. meta: {
  268. title: "支付",
  269. noKeepAlive: true,
  270. },
  271. children: null,
  272. },
  273. {
  274. path: "goodsList",
  275. name: "GoodsList",
  276. component: "@/views/mall/goodsList/index",
  277. meta: {
  278. title: "商品列表",
  279. },
  280. },
  281. ],
  282. },
  283. {
  284. path: "/error",
  285. component: "EmptyLayout",
  286. redirect: "noRedirect",
  287. name: "Error",
  288. meta: { title: "错误页", icon: "bug" },
  289. children: [
  290. {
  291. path: "401",
  292. name: "Error401",
  293. component: "@/views/401",
  294. meta: { title: "401" },
  295. },
  296. {
  297. path: "404",
  298. name: "Error404",
  299. component: "@/views/404",
  300. meta: { title: "404" },
  301. },
  302. ],
  303. },
  304. ];
  305. module.exports = [
  306. {
  307. url: "/menu/navigate",
  308. type: "post",
  309. response() {
  310. return { code: 200, msg: "success", data: data };
  311. },
  312. },
  313. ];