asyncRoutes.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // 根据角色动态生成路由
  2. import { MockMethod } from "vite-plugin-mock";
  3. // http://mockjs.com/examples.html#Object
  4. const systemRouter = {
  5. path: "/system",
  6. name: "system",
  7. // component: Layout,
  8. redirect: "/system/user",
  9. meta: {
  10. icon: "el-icon-setting",
  11. title: "message.hssysManagement",
  12. showLink: true,
  13. savedPosition: true,
  14. rank: 6,
  15. },
  16. children: [
  17. {
  18. path: "/system/user",
  19. name: "user",
  20. // component: () => import("/@/views/system/user/index.vue"),
  21. meta: {
  22. title: "message.hsBaseinfo",
  23. showLink: false,
  24. savedPosition: true,
  25. },
  26. },
  27. {
  28. path: "/system/dict",
  29. name: "dict",
  30. // component: () => import("/@/views/system/dict/index.vue"),
  31. meta: {
  32. title: "message.hsDict",
  33. showLink: false,
  34. savedPosition: true,
  35. },
  36. },
  37. ],
  38. };
  39. export default [
  40. {
  41. url: "/getAsyncRoutes",
  42. method: "get",
  43. response: () => {
  44. return {
  45. code: 0,
  46. info: systemRouter,
  47. };
  48. },
  49. },
  50. ] as MockMethod[];