index.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. import config from '@/config/axios/config'
  2. import { MockMethod } from 'vite-plugin-mock'
  3. import Mock from 'mockjs'
  4. import { toAnyString } from '@/utils'
  5. const { code } = config
  6. const timeout = 1
  7. const adminList = [
  8. {
  9. path: '/dashboard',
  10. component: '#',
  11. redirect: '/dashboard/analysis',
  12. name: 'Dashboard',
  13. meta: {
  14. title: 'router.dashboard',
  15. icon: 'ant-design:dashboard-filled',
  16. alwaysShow: true
  17. },
  18. children: [
  19. {
  20. path: 'analysis',
  21. component: 'views/Dashboard/Analysis',
  22. name: 'Analysis',
  23. meta: {
  24. title: 'router.analysis',
  25. noCache: true
  26. }
  27. },
  28. {
  29. path: 'workplace',
  30. component: 'views/Dashboard/Workplace',
  31. name: 'Workplace',
  32. meta: {
  33. title: 'router.workplace',
  34. noCache: true
  35. }
  36. }
  37. ]
  38. },
  39. {
  40. path: '/manage',
  41. component: '#',
  42. redirect: '/manage/news-page',
  43. name: 'Manage',
  44. meta: {
  45. title: '模块管理',
  46. icon: 'ep:menu',
  47. alwaysShow: true
  48. },
  49. children: [
  50. {
  51. path: 'news-page',
  52. component: 'views/Manage/News/NewsPage',
  53. name: 'NewsPage',
  54. meta: {
  55. title: '新闻管理'
  56. }
  57. },
  58. {
  59. path: 'news-add',
  60. component: 'views/Manage/News/NewsAdd',
  61. name: 'NewsAdd',
  62. meta: {
  63. title: '新增新闻',
  64. noTagsView: true,
  65. noCache: true,
  66. hidden: true,
  67. canTo: true,
  68. activeMenu: '/manage/news-page'
  69. }
  70. },
  71. {
  72. path: 'news-edit',
  73. component: 'views/Manage/News/NewsEdit',
  74. name: 'NewsEdit',
  75. meta: {
  76. title: '编辑新闻',
  77. noTagsView: true,
  78. noCache: true,
  79. hidden: true,
  80. canTo: true,
  81. activeMenu: '/manage/news-page'
  82. }
  83. },
  84. {
  85. path: 'useValidator',
  86. component: 'views/hooks/useValidator',
  87. name: 'UseValidator',
  88. meta: {
  89. title: 'useValidator'
  90. }
  91. }
  92. // {
  93. // path: 'useCrudSchemas',
  94. // component: 'views/hooks/useCrudSchemas',
  95. // name: 'UseCrudSchemas',
  96. // meta: {
  97. // title: 'useCrudSchemas'
  98. // }
  99. // }
  100. ]
  101. },
  102. {
  103. path: '/level',
  104. component: '#',
  105. redirect: '/level/menu1/menu1-1/menu1-1-1',
  106. name: 'Level',
  107. meta: {
  108. title: 'router.level',
  109. icon: 'carbon:skill-level-advanced'
  110. },
  111. children: [
  112. {
  113. path: 'menu1',
  114. name: 'Menu1',
  115. component: '##',
  116. redirect: '/level/menu1/menu1-1/menu1-1-1',
  117. meta: {
  118. title: 'router.menu1'
  119. },
  120. children: [
  121. {
  122. path: 'menu1-1',
  123. name: 'Menu11',
  124. component: '##',
  125. redirect: '/level/menu1/menu1-1/menu1-1-1',
  126. meta: {
  127. title: 'router.menu11',
  128. alwaysShow: true
  129. },
  130. children: [
  131. {
  132. path: 'menu1-1-1',
  133. name: 'Menu111',
  134. component: 'views/Level/Menu111',
  135. meta: {
  136. title: 'router.menu111'
  137. }
  138. }
  139. ]
  140. },
  141. {
  142. path: 'menu1-2',
  143. name: 'Menu12',
  144. component: 'views/Level/Menu12',
  145. meta: {
  146. title: 'router.menu12'
  147. }
  148. }
  149. ]
  150. },
  151. {
  152. path: 'news-detail',
  153. component: 'views/Manage/News/NewsDetail',
  154. name: 'NewsDetail',
  155. meta: {
  156. title: '新闻详情',
  157. noTagsView: true,
  158. noCache: true,
  159. hidden: true,
  160. canTo: true,
  161. activeMenu: '/manage/news-page'
  162. }
  163. },
  164. {
  165. path: 'product-page',
  166. component: 'views/Manage/Product/ProductPage',
  167. name: 'ProductPage',
  168. meta: {
  169. title: '产品管理'
  170. }
  171. },
  172. {
  173. path: 'product-add',
  174. component: 'views/Manage/Product/ProductAdd',
  175. name: 'ProductAdd',
  176. meta: {
  177. title: '新增产品',
  178. noTagsView: true,
  179. noCache: true,
  180. hidden: true,
  181. canTo: true,
  182. activeMenu: '/manage/product-page'
  183. }
  184. },
  185. {
  186. path: 'product-edit',
  187. component: 'views/Manage/Product/ProductEdit',
  188. name: 'ProductEdit',
  189. meta: {
  190. title: '编辑产品',
  191. noTagsView: true,
  192. noCache: true,
  193. hidden: true,
  194. canTo: true,
  195. activeMenu: '/manage/product-page'
  196. }
  197. },
  198. {
  199. path: 'product-detail',
  200. component: 'views/Manage/Product/ProductDetail',
  201. name: 'ProductDetail',
  202. meta: {
  203. title: '产品详情',
  204. noTagsView: true,
  205. noCache: true,
  206. hidden: true,
  207. canTo: true,
  208. activeMenu: '/manage/product-page'
  209. }
  210. }
  211. ]
  212. },
  213. {
  214. path: '/example',
  215. component: '#',
  216. redirect: '/example/example-page',
  217. name: 'Example',
  218. meta: {
  219. title: 'router.example',
  220. icon: 'ep:management',
  221. alwaysShow: true
  222. },
  223. children: [
  224. {
  225. path: 'example-page',
  226. component: 'views/Example/Page/ExamplePage',
  227. name: 'ExamplePage',
  228. meta: {
  229. title: 'router.examplePage'
  230. }
  231. },
  232. {
  233. path: 'example-add',
  234. component: 'views/Example/Page/ExampleAdd',
  235. name: 'ExampleAdd',
  236. meta: {
  237. title: 'router.exampleAdd',
  238. noTagsView: true,
  239. noCache: true,
  240. hidden: true,
  241. canTo: true,
  242. activeMenu: '/example/example-page'
  243. }
  244. },
  245. {
  246. path: 'example-edit',
  247. component: 'views/Example/Page/ExampleEdit',
  248. name: 'ExampleEdit',
  249. meta: {
  250. title: 'router.exampleEdit',
  251. noTagsView: true,
  252. noCache: true,
  253. hidden: true,
  254. canTo: true,
  255. activeMenu: '/example/example-page'
  256. }
  257. },
  258. {
  259. path: 'example-detail',
  260. component: 'views/Example/Page/ExampleDetail',
  261. name: 'ExampleDetail',
  262. meta: {
  263. title: 'router.exampleDetail',
  264. noTagsView: true,
  265. noCache: true,
  266. hidden: true,
  267. canTo: true,
  268. activeMenu: '/example/example-page'
  269. }
  270. }
  271. ]
  272. },
  273. {
  274. path: '/authorization',
  275. component: '#',
  276. redirect: '/authorization/user',
  277. name: 'Authorization',
  278. meta: {
  279. title: 'router.authorization',
  280. icon: 'eos-icons:role-binding',
  281. alwaysShow: true
  282. },
  283. children: [
  284. {
  285. path: 'department',
  286. component: 'views/Authorization/Department/Department',
  287. name: 'Department',
  288. meta: {
  289. title: 'router.department'
  290. }
  291. },
  292. {
  293. path: 'user',
  294. component: 'views/Authorization/User/User',
  295. name: 'User',
  296. meta: {
  297. title: 'router.user'
  298. }
  299. },
  300. {
  301. path: 'menu',
  302. component: 'views/Authorization/Menu/Menu',
  303. name: 'Menu',
  304. meta: {
  305. title: 'router.menuManagement'
  306. }
  307. },
  308. {
  309. path: 'role',
  310. component: 'views/Authorization/Role/Role',
  311. name: 'Role',
  312. meta: {
  313. title: 'router.role'
  314. }
  315. },
  316. {
  317. path: 'test',
  318. component: 'views/Authorization/Test/Test',
  319. name: 'Test',
  320. meta: {
  321. title: 'router.permission',
  322. permission: ['add', 'edit', 'delete']
  323. }
  324. }
  325. ]
  326. }
  327. ]
  328. const testList: string[] = [
  329. '/dashboard',
  330. '/dashboard/analysis',
  331. '/dashboard/workplace',
  332. 'external-link',
  333. 'https://element-plus-admin-doc.cn/',
  334. '/guide',
  335. '/guide/index',
  336. '/components',
  337. '/components/form',
  338. '/components/form/default-form',
  339. '/components/form/use-form',
  340. '/components/form/ref-form',
  341. '/components/table',
  342. '/components/table/default-table',
  343. '/components/table/use-table',
  344. '/components/table/tree-table',
  345. '/components/table/table-image-preview',
  346. '/components/table/ref-table',
  347. '/components/editor-demo',
  348. '/components/editor-demo/editor',
  349. '/components/search',
  350. '/components/descriptions',
  351. '/components/image-viewer',
  352. '/components/dialog',
  353. '/components/icon',
  354. '/components/echart',
  355. '/components/count-to',
  356. '/components/qrcode',
  357. '/components/highlight',
  358. '/components/infotip',
  359. '/Components/InputPassword',
  360. '/Components/Sticky',
  361. 'function',
  362. '/function/multiple-tabs',
  363. '/function/multiple-tabs-demo/:id',
  364. '/hooks',
  365. '/hooks/useWatermark',
  366. '/hooks/useTagsView',
  367. '/hooks/useValidator',
  368. // '/hooks/useCrudSchemas',
  369. '/level',
  370. '/level/menu1',
  371. '/level/menu1/menu1-1',
  372. '/level/menu1/menu1-1/menu1-1-1',
  373. '/level/menu1/menu1-2',
  374. '/level/menu2',
  375. '/example',
  376. '/example/example-dialog',
  377. '/example/example-page',
  378. '/example/example-add',
  379. '/example/example-edit',
  380. '/example/example-detail',
  381. '/authorization',
  382. '/authorization/department',
  383. '/authorization/user',
  384. '/authorization/role',
  385. '/authorization/menu',
  386. '/authorization/test',
  387. '/error',
  388. '/error/404-demo',
  389. '/error/403-demo',
  390. '/error/500-demo'
  391. ]
  392. const List: any[] = []
  393. const roleNames = ['超级管理员', '管理员', '普通用户', '游客']
  394. const menus = [
  395. [
  396. {
  397. path: '/dashboard',
  398. component: '#',
  399. redirect: '/dashboard/analysis',
  400. name: 'Dashboard',
  401. status: Mock.Random.integer(0, 1),
  402. id: 1,
  403. meta: {
  404. title: '首页',
  405. icon: 'ant-design:dashboard-filled',
  406. alwaysShow: true
  407. },
  408. children: [
  409. {
  410. path: 'analysis',
  411. component: 'views/Dashboard/Analysis',
  412. name: 'Analysis',
  413. status: Mock.Random.integer(0, 1),
  414. id: 2,
  415. meta: {
  416. title: '分析页',
  417. noCache: true
  418. }
  419. },
  420. {
  421. path: 'workplace',
  422. component: 'views/Dashboard/Workplace',
  423. name: 'Workplace',
  424. status: Mock.Random.integer(0, 1),
  425. id: 3,
  426. meta: {
  427. title: '工作台',
  428. noCache: true
  429. }
  430. }
  431. ]
  432. },
  433. {
  434. path: '/external-link',
  435. component: '#',
  436. meta: {
  437. title: '文档',
  438. icon: 'clarity:document-solid'
  439. },
  440. name: 'ExternalLink',
  441. status: Mock.Random.integer(0, 1),
  442. id: 4,
  443. children: [
  444. {
  445. path: 'https://element-plus-admin-doc.cn/',
  446. name: 'DocumentLink',
  447. status: Mock.Random.integer(0, 1),
  448. id: 5,
  449. meta: {
  450. title: '文档'
  451. }
  452. }
  453. ]
  454. },
  455. {
  456. path: '/level',
  457. component: '#',
  458. redirect: '/level/menu1/menu1-1/menu1-1-1',
  459. name: 'Level',
  460. status: Mock.Random.integer(0, 1),
  461. id: 6,
  462. meta: {
  463. title: '菜单',
  464. icon: 'carbon:skill-level-advanced'
  465. },
  466. children: [
  467. {
  468. path: 'menu1',
  469. name: 'Menu1',
  470. component: '##',
  471. status: Mock.Random.integer(0, 1),
  472. id: 7,
  473. redirect: '/level/menu1/menu1-1/menu1-1-1',
  474. meta: {
  475. title: '菜单1'
  476. },
  477. children: [
  478. {
  479. path: 'menu1-1',
  480. name: 'Menu11',
  481. component: '##',
  482. status: Mock.Random.integer(0, 1),
  483. id: 8,
  484. redirect: '/level/menu1/menu1-1/menu1-1-1',
  485. meta: {
  486. title: '菜单1-1',
  487. alwaysShow: true
  488. },
  489. children: [
  490. {
  491. path: 'menu1-1-1',
  492. name: 'Menu111',
  493. component: 'views/Level/Menu111',
  494. status: Mock.Random.integer(0, 1),
  495. id: 9,
  496. permission: ['edit', 'add', 'delete'],
  497. meta: {
  498. title: '菜单1-1-1',
  499. permission: ['edit', 'add', 'delete']
  500. }
  501. }
  502. ]
  503. },
  504. {
  505. path: 'menu1-2',
  506. name: 'Menu12',
  507. component: 'views/Level/Menu12',
  508. status: Mock.Random.integer(0, 1),
  509. id: 10,
  510. permission: ['edit', 'add', 'delete'],
  511. meta: {
  512. title: '菜单1-2',
  513. permission: ['edit', 'add', 'delete']
  514. }
  515. }
  516. ]
  517. },
  518. {
  519. path: 'menu2',
  520. name: 'Menu2Demo',
  521. component: 'views/Level/Menu2',
  522. status: Mock.Random.integer(0, 1),
  523. id: 11,
  524. permission: ['edit', 'add', 'delete'],
  525. meta: {
  526. title: '菜单2',
  527. permission: ['edit', 'add', 'delete']
  528. }
  529. }
  530. ]
  531. },
  532. {
  533. path: '/example',
  534. component: '#',
  535. redirect: '/example/example-dialog',
  536. name: 'Example',
  537. status: Mock.Random.integer(0, 1),
  538. id: 12,
  539. meta: {
  540. title: '综合示例',
  541. icon: 'ep:management',
  542. alwaysShow: true
  543. },
  544. children: [
  545. {
  546. path: 'example-dialog',
  547. component: 'views/Example/Dialog/ExampleDialog',
  548. name: 'ExampleDialog',
  549. status: Mock.Random.integer(0, 1),
  550. id: 13,
  551. permission: ['edit', 'add', 'delete'],
  552. meta: {
  553. title: '综合示例-弹窗',
  554. permission: ['edit', 'add', 'delete']
  555. }
  556. },
  557. {
  558. path: 'example-page',
  559. component: 'views/Example/Page/ExamplePage',
  560. name: 'ExamplePage',
  561. status: Mock.Random.integer(0, 1),
  562. id: 14,
  563. permission: ['edit', 'add', 'delete'],
  564. meta: {
  565. title: '综合示例-页面',
  566. permission: ['edit', 'add', 'delete']
  567. }
  568. },
  569. {
  570. path: 'example-add',
  571. component: 'views/Example/Page/ExampleAdd',
  572. name: 'ExampleAdd',
  573. status: Mock.Random.integer(0, 1),
  574. id: 15,
  575. permission: ['edit', 'add', 'delete'],
  576. meta: {
  577. title: '综合示例-新增',
  578. noTagsView: true,
  579. noCache: true,
  580. hidden: true,
  581. canTo: true,
  582. activeMenu: '/example/example-page',
  583. permission: ['edit', 'add', 'delete']
  584. }
  585. },
  586. {
  587. path: 'example-edit',
  588. component: 'views/Example/Page/ExampleEdit',
  589. name: 'ExampleEdit',
  590. status: Mock.Random.integer(0, 1),
  591. id: 16,
  592. permission: ['edit', 'add', 'delete'],
  593. meta: {
  594. title: '综合示例-编辑',
  595. noTagsView: true,
  596. noCache: true,
  597. hidden: true,
  598. canTo: true,
  599. activeMenu: '/example/example-page',
  600. permission: ['edit', 'add', 'delete']
  601. }
  602. },
  603. {
  604. path: 'example-detail',
  605. component: 'views/Example/Page/ExampleDetail',
  606. name: 'ExampleDetail',
  607. status: Mock.Random.integer(0, 1),
  608. id: 17,
  609. permission: ['edit', 'add', 'delete'],
  610. meta: {
  611. title: '综合示例-详情',
  612. noTagsView: true,
  613. noCache: true,
  614. hidden: true,
  615. canTo: true,
  616. activeMenu: '/example/example-page',
  617. permission: ['edit', 'add', 'delete']
  618. }
  619. }
  620. ]
  621. }
  622. ],
  623. [
  624. {
  625. path: '/dashboard',
  626. component: '#',
  627. redirect: '/dashboard/analysis',
  628. name: 'Dashboard',
  629. status: Mock.Random.integer(0, 1),
  630. id: 1,
  631. meta: {
  632. title: '首页',
  633. icon: 'ant-design:dashboard-filled',
  634. alwaysShow: true
  635. },
  636. children: [
  637. {
  638. path: 'analysis',
  639. component: 'views/Dashboard/Analysis',
  640. name: 'Analysis',
  641. status: Mock.Random.integer(0, 1),
  642. id: 2,
  643. meta: {
  644. title: '分析页',
  645. noCache: true
  646. }
  647. },
  648. {
  649. path: 'workplace',
  650. component: 'views/Dashboard/Workplace',
  651. name: 'Workplace',
  652. status: Mock.Random.integer(0, 1),
  653. id: 3,
  654. meta: {
  655. title: '工作台',
  656. noCache: true
  657. }
  658. }
  659. ]
  660. }
  661. ],
  662. [
  663. {
  664. path: '/external-link',
  665. component: '#',
  666. meta: {
  667. title: '文档',
  668. icon: 'clarity:document-solid'
  669. },
  670. name: 'ExternalLink',
  671. status: Mock.Random.integer(0, 1),
  672. id: 4,
  673. children: [
  674. {
  675. path: 'https://element-plus-admin-doc.cn/',
  676. name: 'DocumentLink',
  677. status: Mock.Random.integer(0, 1),
  678. id: 5,
  679. meta: {
  680. title: '文档'
  681. }
  682. }
  683. ]
  684. },
  685. {
  686. path: '/level',
  687. component: '#',
  688. redirect: '/level/menu1/menu1-1/menu1-1-1',
  689. name: 'Level',
  690. status: Mock.Random.integer(0, 1),
  691. id: 6,
  692. meta: {
  693. title: '菜单',
  694. icon: 'carbon:skill-level-advanced'
  695. },
  696. children: [
  697. {
  698. path: 'menu1',
  699. name: 'Menu1',
  700. component: '##',
  701. status: Mock.Random.integer(0, 1),
  702. id: 7,
  703. redirect: '/level/menu1/menu1-1/menu1-1-1',
  704. meta: {
  705. title: '菜单1'
  706. },
  707. children: [
  708. {
  709. path: 'menu1-1',
  710. name: 'Menu11',
  711. component: '##',
  712. status: Mock.Random.integer(0, 1),
  713. id: 8,
  714. redirect: '/level/menu1/menu1-1/menu1-1-1',
  715. meta: {
  716. title: '菜单1-1',
  717. alwaysShow: true
  718. },
  719. children: [
  720. {
  721. path: 'menu1-1-1',
  722. name: 'Menu111',
  723. component: 'views/Level/Menu111',
  724. status: Mock.Random.integer(0, 1),
  725. id: 9,
  726. permission: ['edit', 'add', 'delete'],
  727. meta: {
  728. title: '菜单1-1-1',
  729. permission: ['edit', 'add', 'delete']
  730. }
  731. }
  732. ]
  733. },
  734. {
  735. path: 'menu1-2',
  736. name: 'Menu12',
  737. component: 'views/Level/Menu12',
  738. status: Mock.Random.integer(0, 1),
  739. id: 10,
  740. permission: ['edit', 'add', 'delete'],
  741. meta: {
  742. title: '菜单1-2',
  743. permission: ['edit', 'add', 'delete']
  744. }
  745. }
  746. ]
  747. },
  748. {
  749. path: 'menu2',
  750. name: 'Menu2Demo',
  751. component: 'views/Level/Menu2',
  752. status: Mock.Random.integer(0, 1),
  753. id: 11,
  754. permission: ['edit', 'add', 'delete'],
  755. meta: {
  756. title: '菜单2',
  757. permission: ['edit', 'add', 'delete']
  758. }
  759. }
  760. ]
  761. }
  762. ],
  763. [
  764. {
  765. path: '/example',
  766. component: '#',
  767. redirect: '/example/example-dialog',
  768. name: 'Example',
  769. status: Mock.Random.integer(0, 1),
  770. id: 12,
  771. meta: {
  772. title: '综合示例',
  773. icon: 'ep:management',
  774. alwaysShow: true
  775. },
  776. children: [
  777. {
  778. path: 'example-detail',
  779. component: 'views/Example/Page/ExampleDetail',
  780. name: 'ExampleDetail',
  781. status: Mock.Random.integer(0, 1),
  782. id: 17,
  783. permission: ['edit', 'add', 'delete'],
  784. meta: {
  785. title: '综合示例-详情',
  786. noTagsView: true,
  787. noCache: true,
  788. hidden: true,
  789. canTo: true,
  790. activeMenu: '/example/example-page',
  791. permission: ['edit', 'add', 'delete']
  792. }
  793. }
  794. ]
  795. }
  796. ]
  797. ]
  798. for (let i = 0; i < 4; i++) {
  799. List.push(
  800. Mock.mock({
  801. id: toAnyString(),
  802. // timestamp: +Mock.Random.date('T'),
  803. roleName: roleNames[i],
  804. role: '@first',
  805. status: Mock.Random.integer(0, 1),
  806. createTime: '@datetime',
  807. remark: '@cword(10, 15)',
  808. menu: menus[i]
  809. })
  810. )
  811. }
  812. export default [
  813. // 列表接口
  814. {
  815. url: '/role/list',
  816. method: 'get',
  817. timeout,
  818. response: ({ query }) => {
  819. const { roleName } = query
  820. return {
  821. data: {
  822. code: code,
  823. data: roleName === 'admin' ? adminList : testList
  824. }
  825. }
  826. }
  827. },
  828. {
  829. url: '/role/table',
  830. method: 'get',
  831. timeout,
  832. response: () => {
  833. return {
  834. data: {
  835. code: code,
  836. data: {
  837. list: List,
  838. total: 4
  839. }
  840. }
  841. }
  842. }
  843. }
  844. ] as MockMethod[]