router.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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: "/personalCenter",
  21. component: "Layout",
  22. hidden: true,
  23. redirect: "personalCenter",
  24. children: [
  25. {
  26. path: "personalCenter",
  27. name: "PersonalCenter",
  28. component: "@/views/personalCenter/index",
  29. meta: {
  30. title: "个人中心",
  31. },
  32. },
  33. ],
  34. },
  35. {
  36. path: "/personnelManagement",
  37. component: "Layout",
  38. redirect: "noRedirect",
  39. name: "PersonnelManagement",
  40. meta: { title: "人员", icon: "users-cog", permissions: ["admin"] },
  41. children: [
  42. {
  43. path: "userManagement",
  44. name: "UserManagement",
  45. component: "@/views/personnelManagement/userManagement/index",
  46. meta: { title: "用户管理" },
  47. },
  48. {
  49. path: "roleManagement",
  50. name: "RoleManagement",
  51. component: "@/views/personnelManagement/roleManagement/index",
  52. meta: { title: "角色管理" },
  53. },
  54. {
  55. path: "menuManagement",
  56. name: "MenuManagement",
  57. component: "@/views/personnelManagement/menuManagement/index",
  58. meta: { title: "菜单管理", badge: "New" },
  59. },
  60. ],
  61. },
  62. {
  63. path: "/vab",
  64. component: "Layout",
  65. redirect: "noRedirect",
  66. name: "Vab",
  67. alwaysShow: true,
  68. meta: { title: "组件", icon: "cloud" },
  69. children: [
  70. {
  71. path: "permissions",
  72. name: "Permission",
  73. component: "@/views/vab/permissions/index",
  74. meta: {
  75. title: "权限控制",
  76. permissions: ["admin", "editor"],
  77. badge: "New",
  78. },
  79. },
  80. {
  81. path: "icon",
  82. component: "EmptyLayout",
  83. redirect: "noRedirect",
  84. name: "Icon",
  85. meta: {
  86. title: "图标",
  87. permissions: ["admin"],
  88. },
  89. children: [
  90. {
  91. path: "awesomeIcon",
  92. name: "AwesomeIcon",
  93. component: "@/views/vab/icon/index",
  94. meta: { title: "常规图标" },
  95. },
  96. {
  97. path: "remixIcon",
  98. name: "RemixIcon",
  99. component: "@/views/vab/icon/remixIcon",
  100. meta: { title: "小清新图标" },
  101. },
  102. {
  103. path: "colorfulIcon",
  104. name: "ColorfulIcon",
  105. component: "@/views/vab/icon/colorfulIcon",
  106. meta: { title: "多彩图标" },
  107. },
  108. ],
  109. },
  110. {
  111. path: "table",
  112. component: "EmptyLayout",
  113. redirect: "noRedirect",
  114. name: "Table",
  115. meta: {
  116. title: "表格",
  117. permissions: ["admin"],
  118. },
  119. children: [
  120. {
  121. path: "comprehensiveTable",
  122. name: "ComprehensiveTable",
  123. component: "@/views/vab/table/index",
  124. meta: { title: "综合表格" },
  125. },
  126. {
  127. path: "inlineEditTable",
  128. name: "InlineEditTable",
  129. component: "@/views/vab/table/inlineEditTable",
  130. meta: { title: "行内编辑" },
  131. },
  132. ],
  133. },
  134. {
  135. path: "map",
  136. name: "Map",
  137. component: "@/views/vab/map/index",
  138. meta: { title: "地图", permissions: ["admin"], badge: "Pro" },
  139. },
  140. {
  141. path: "webSocket",
  142. name: "WebSocket",
  143. component: "@/views/vab/webSocket/index",
  144. meta: { title: "webSocket", permissions: ["admin"] },
  145. },
  146. {
  147. path: "form",
  148. name: "Form",
  149. component: "@/views/vab/form/index",
  150. meta: { title: "表单", permissions: ["admin"] },
  151. },
  152. {
  153. path: "element",
  154. name: "Element",
  155. component: "@/views/vab/element/index",
  156. meta: { title: "常用组件", permissions: ["admin"] },
  157. },
  158. {
  159. path: "tree",
  160. name: "Tree",
  161. component: "@/views/vab/tree/index",
  162. meta: { title: "树", permissions: ["admin"] },
  163. },
  164. {
  165. path: "card",
  166. name: "Card",
  167. component: "@/views/vab/card/index",
  168. meta: { title: "卡片", permissions: ["admin"] },
  169. },
  170. {
  171. path: "verify",
  172. name: "Verify",
  173. component: "@/views/vab/verify/index",
  174. meta: { title: "验证码", permissions: ["admin"] },
  175. },
  176. {
  177. path: "menu1",
  178. component: "@/views/vab/nested/menu1/index",
  179. name: "Menu1",
  180. alwaysShow: true,
  181. meta: {
  182. title: "嵌套路由 1",
  183. permissions: ["admin"],
  184. },
  185. children: [
  186. {
  187. path: "menu1-1",
  188. name: "Menu1-1",
  189. alwaysShow: true,
  190. meta: { title: "嵌套路由 1-1" },
  191. component: "@/views/vab/nested/menu1/menu1-1/index",
  192. children: [
  193. {
  194. path: "menu1-1-1",
  195. name: "Menu1-1-1",
  196. meta: { title: "嵌套路由 1-1-1" },
  197. component: "@/views/vab/nested/menu1/menu1-1/menu1-1-1/index",
  198. },
  199. ],
  200. },
  201. ],
  202. },
  203. {
  204. path: "magnifier",
  205. name: "Magnifier",
  206. component: "@/views/vab/magnifier/index",
  207. meta: { title: "放大镜", permissions: ["admin"] },
  208. },
  209. {
  210. path: "echarts",
  211. name: "Echarts",
  212. component: "@/views/vab/echarts/index",
  213. meta: { title: "图表", permissions: ["admin"] },
  214. },
  215. {
  216. path: "loading",
  217. name: "Loading",
  218. component: "@/views/vab/loading/index",
  219. meta: { title: "loading", permissions: ["admin"] },
  220. },
  221. {
  222. path: "player",
  223. name: "Player",
  224. component: "@/views/vab/player/index",
  225. meta: { title: "视频播放器", permissions: ["admin"] },
  226. },
  227. {
  228. path: "markdownEditor",
  229. name: "MarkdownEditor",
  230. component: "@/views/vab/markdownEditor/index",
  231. meta: { title: "markdown编辑器", permissions: ["admin"] },
  232. },
  233. {
  234. path: "editor",
  235. name: "Editor",
  236. component: "@/views/vab/editor/index",
  237. meta: { title: "富文本编辑器", permissions: ["admin"], badge: "New" },
  238. },
  239. {
  240. path: "backToTop",
  241. name: "BackToTop",
  242. component: "@/views/vab/backToTop/index",
  243. meta: { title: "返回顶部", permissions: ["admin"] },
  244. },
  245. {
  246. path: "lodash",
  247. name: "Lodash",
  248. component: "@/views/vab/lodash/index",
  249. meta: { title: "lodash", permissions: ["admin"] },
  250. },
  251. {
  252. path: "imgComparison",
  253. name: "ImgComparison",
  254. component: "@/views/vab/imgComparison/index",
  255. meta: { title: "图像拖拽比对", permissions: ["admin"] },
  256. },
  257. {
  258. path: "markdown",
  259. name: "Markdown",
  260. component: "@/views/vab/markdown/index",
  261. meta: { title: "markdown阅读器", permissions: ["admin"] },
  262. },
  263. {
  264. path: "smallComponents",
  265. name: "SmallComponents",
  266. component: "@/views/vab/smallComponents/index",
  267. meta: { title: "小组件", permissions: ["admin"] },
  268. },
  269. {
  270. path: "upload",
  271. name: "Upload",
  272. component: "@/views/vab/upload/index",
  273. meta: { title: "上传", permissions: ["admin"] },
  274. },
  275. {
  276. path: "log",
  277. name: "Log",
  278. component: "@/views/vab/errorLog/index",
  279. meta: { title: "错误日志模拟", permissions: ["admin"] },
  280. },
  281. {
  282. path: "more",
  283. name: "More",
  284. component: "@/views/vab/more/index",
  285. meta: { title: "更多组件", permissions: ["admin"] },
  286. },
  287. ],
  288. },
  289. {
  290. path: "/mall",
  291. component: "Layout",
  292. redirect: "noRedirect",
  293. name: "Mall",
  294. meta: {
  295. title: "商城",
  296. icon: "shopping-cart",
  297. permissions: ["admin"],
  298. },
  299. children: [
  300. {
  301. path: "pay",
  302. name: "Pay",
  303. component: "@/views/mall/pay/index",
  304. meta: {
  305. title: "支付",
  306. noKeepAlive: true,
  307. },
  308. children: null,
  309. },
  310. {
  311. path: "goodsList",
  312. name: "GoodsList",
  313. component: "@/views/mall/goodsList/index",
  314. meta: {
  315. title: "商品列表",
  316. },
  317. },
  318. {
  319. path: "goodsDetail",
  320. name: "GoodsDetail",
  321. component: "@/views/mall/goodsDetail/index",
  322. meta: {
  323. title: "商品详情",
  324. },
  325. },
  326. ],
  327. },
  328. {
  329. path: "/error",
  330. component: "EmptyLayout",
  331. redirect: "noRedirect",
  332. name: "Error",
  333. meta: { title: "错误页", icon: "bug" },
  334. children: [
  335. {
  336. path: "401",
  337. name: "Error401",
  338. component: "@/views/401",
  339. meta: { title: "401" },
  340. },
  341. {
  342. path: "404",
  343. name: "Error404",
  344. component: "@/views/404",
  345. meta: { title: "404" },
  346. },
  347. ],
  348. },
  349. ];
  350. module.exports = [
  351. {
  352. url: "/menu/navigate",
  353. type: "post",
  354. response() {
  355. return { code: 200, msg: "success", data: data };
  356. },
  357. },
  358. ];