router.js 8.6 KB

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