menus.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import { resultSuccess } from '../_util';
  2. //超级管理员
  3. const adminMenusList = [
  4. {
  5. path: '/dashboard',
  6. name: 'Dashboard',
  7. component: 'LAYOUT',
  8. redirect: '/dashboard/console',
  9. meta: {
  10. icon: 'DashboardOutlined',
  11. title: 'Dashboard',
  12. },
  13. children: [
  14. {
  15. path: 'console',
  16. name: 'dashboard_console',
  17. component: '/dashboard/console/console',
  18. meta: {
  19. title: '主控台',
  20. },
  21. },
  22. {
  23. path: 'monitor',
  24. name: 'dashboard_monitor',
  25. component: '/dashboard/monitor/monitor',
  26. meta: {
  27. title: '监控页',
  28. },
  29. },
  30. {
  31. path: 'workplace',
  32. name: 'dashboard_workplace',
  33. component: '/dashboard/workplace/workplace',
  34. meta: {
  35. hidden: true,
  36. title: '工作台',
  37. },
  38. },
  39. ],
  40. },
  41. {
  42. path: '/list',
  43. name: 'List',
  44. component: 'LAYOUT',
  45. redirect: '/list/basic-list',
  46. meta: {
  47. icon: 'TableOutlined',
  48. title: '列表页面',
  49. },
  50. children: [
  51. {
  52. path: 'basic-list',
  53. name: 'basic-list',
  54. component: '/list/basicList/index',
  55. meta: {
  56. title: '基础列表',
  57. },
  58. },
  59. ],
  60. },
  61. ];
  62. //普通管理员
  63. const ordinaryMenusList = [
  64. {
  65. path: '/dashboard',
  66. name: 'Dashboard',
  67. component: 'LAYOUT',
  68. redirect: '/dashboard/console',
  69. meta: {
  70. icon: 'DashboardOutlined',
  71. title: 'Dashboard',
  72. },
  73. children: [
  74. {
  75. path: 'console',
  76. name: 'dashboard_console',
  77. component: '/dashboard/console/console',
  78. meta: {
  79. title: '主控台',
  80. },
  81. },
  82. {
  83. path: 'monitor',
  84. name: 'dashboard_monitor',
  85. component: '/dashboard/monitor/monitor',
  86. meta: {
  87. title: '监控页',
  88. },
  89. },
  90. {
  91. path: 'workplace',
  92. name: 'dashboard_workplace',
  93. component: '/dashboard/workplace/workplace',
  94. meta: {
  95. hidden: true,
  96. title: '工作台',
  97. },
  98. },
  99. ],
  100. },
  101. ];
  102. export default [
  103. {
  104. url: '/api/menus',
  105. timeout: 1000,
  106. method: 'get',
  107. response: () => {
  108. //此处随机了,为了模拟不同角色权限
  109. const randomNum = Math.floor(Math.random() * 2 + 1);
  110. return randomNum === 1 ? resultSuccess(adminMenusList) : resultSuccess(ordinaryMenusList);
  111. },
  112. },
  113. ];