system.ts 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799
  1. import { defineFakeRoute } from "vite-plugin-fake-server/client";
  2. import { faker } from "@faker-js/faker/locale/zh_CN";
  3. export default defineFakeRoute([
  4. // 用户管理
  5. {
  6. url: "/user",
  7. method: "post",
  8. response: ({ body }) => {
  9. let list = [
  10. {
  11. avatar: "https://avatars.githubusercontent.com/u/44761321",
  12. username: "admin",
  13. nickname: "小铭",
  14. phone: "15888886789",
  15. email: faker.internet.email(),
  16. sex: 0,
  17. id: 1,
  18. status: 1,
  19. dept: {
  20. // 部门id
  21. id: 103,
  22. // 部门名称
  23. name: "研发部门"
  24. },
  25. remark: "管理员",
  26. createTime: 1605456000000
  27. },
  28. {
  29. avatar: "https://avatars.githubusercontent.com/u/52823142",
  30. username: "common",
  31. nickname: "小林",
  32. phone: "18288882345",
  33. email: faker.internet.email(),
  34. sex: 1,
  35. id: 2,
  36. status: 1,
  37. dept: {
  38. id: 105,
  39. name: "测试部门"
  40. },
  41. remark: "普通用户",
  42. createTime: 1605456000000
  43. }
  44. ];
  45. list = list.filter(item => item.username.includes(body?.username));
  46. list = list.filter(item =>
  47. String(item.status).includes(String(body?.status))
  48. );
  49. if (body.phone) list = list.filter(item => item.phone === body.phone);
  50. if (body.deptId) list = list.filter(item => item.dept.id === body.deptId);
  51. return {
  52. success: true,
  53. data: {
  54. list,
  55. total: list.length, // 总条目数
  56. pageSize: 10, // 每页显示条目个数
  57. currentPage: 1 // 当前页数
  58. }
  59. };
  60. }
  61. },
  62. // 用户管理-获取所有角色列表
  63. {
  64. url: "/list-all-role",
  65. method: "get",
  66. response: () => {
  67. return {
  68. success: true,
  69. data: [
  70. { id: 1, name: "超级管理员" },
  71. { id: 2, name: "普通角色" }
  72. ]
  73. };
  74. }
  75. },
  76. // 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id)
  77. {
  78. url: "/list-role-ids",
  79. method: "post",
  80. response: ({ body }) => {
  81. if (body.userId) {
  82. if (body.userId == 1) {
  83. return {
  84. success: true,
  85. data: [1]
  86. };
  87. } else if (body.userId == 2) {
  88. return {
  89. success: true,
  90. data: [2]
  91. };
  92. }
  93. } else {
  94. return {
  95. success: false,
  96. data: []
  97. };
  98. }
  99. }
  100. },
  101. // 角色管理
  102. {
  103. url: "/role",
  104. method: "post",
  105. response: ({ body }) => {
  106. let list = [
  107. {
  108. createTime: 1605456000000, // 时间戳(毫秒ms)
  109. updateTime: 1684512000000,
  110. id: 1,
  111. name: "超级管理员",
  112. code: "admin",
  113. status: 1, // 状态 1 启用 0 停用
  114. remark: "超级管理员拥有最高权限"
  115. },
  116. {
  117. createTime: 1605456000000,
  118. updateTime: 1684512000000,
  119. id: 2,
  120. name: "普通角色",
  121. code: "common",
  122. status: 1,
  123. remark: "普通角色拥有部分权限"
  124. }
  125. ];
  126. list = list.filter(item => item.name.includes(body?.name));
  127. list = list.filter(item =>
  128. String(item.status).includes(String(body?.status))
  129. );
  130. if (body.code) list = list.filter(item => item.code === body.code);
  131. return {
  132. success: true,
  133. data: {
  134. list,
  135. total: list.length, // 总条目数
  136. pageSize: 10, // 每页显示条目个数
  137. currentPage: 1 // 当前页数
  138. }
  139. };
  140. }
  141. },
  142. // 角色管理-权限-菜单权限
  143. {
  144. url: "/role-menu",
  145. method: "post",
  146. response: () => {
  147. return {
  148. success: true,
  149. data: [
  150. // 外部页面
  151. {
  152. parentId: 0,
  153. id: 100,
  154. menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
  155. title: "menus.pureExternalPage"
  156. },
  157. {
  158. parentId: 100,
  159. id: 101,
  160. menuType: 0,
  161. title: "menus.pureExternalDoc"
  162. },
  163. {
  164. parentId: 101,
  165. id: 102,
  166. menuType: 2,
  167. title: "menus.pureExternalLink"
  168. },
  169. {
  170. parentId: 101,
  171. id: 103,
  172. menuType: 2,
  173. title: "menus.pureUtilsLink"
  174. },
  175. {
  176. parentId: 100,
  177. id: 104,
  178. menuType: 1,
  179. title: "menus.pureEmbeddedDoc"
  180. },
  181. {
  182. parentId: 104,
  183. id: 105,
  184. menuType: 1,
  185. title: "menus.pureEpDoc"
  186. },
  187. {
  188. parentId: 104,
  189. id: 106,
  190. menuType: 1,
  191. title: "menus.pureTailwindcssDoc"
  192. },
  193. {
  194. parentId: 104,
  195. id: 107,
  196. menuType: 1,
  197. title: "menus.pureVueDoc"
  198. },
  199. {
  200. parentId: 104,
  201. id: 108,
  202. menuType: 1,
  203. title: "menus.pureViteDoc"
  204. },
  205. {
  206. parentId: 104,
  207. id: 109,
  208. menuType: 1,
  209. title: "menus.purePiniaDoc"
  210. },
  211. {
  212. parentId: 104,
  213. id: 110,
  214. menuType: 1,
  215. title: "menus.pureRouterDoc"
  216. },
  217. // 权限管理
  218. {
  219. parentId: 0,
  220. id: 200,
  221. menuType: 0,
  222. title: "menus.purePermission"
  223. },
  224. {
  225. parentId: 200,
  226. id: 201,
  227. menuType: 0,
  228. title: "menus.purePermissionPage"
  229. },
  230. {
  231. parentId: 200,
  232. id: 202,
  233. menuType: 0,
  234. title: "menus.purePermissionButton"
  235. },
  236. {
  237. parentId: 202,
  238. id: 203,
  239. menuType: 3,
  240. title: "添加"
  241. },
  242. {
  243. parentId: 202,
  244. id: 204,
  245. menuType: 3,
  246. title: "修改"
  247. },
  248. {
  249. parentId: 202,
  250. id: 205,
  251. menuType: 3,
  252. title: "删除"
  253. },
  254. // 系统管理
  255. {
  256. parentId: 0,
  257. id: 300,
  258. menuType: 0,
  259. title: "menus.pureSysManagement"
  260. },
  261. {
  262. parentId: 300,
  263. id: 301,
  264. menuType: 0,
  265. title: "menus.pureUser"
  266. },
  267. {
  268. parentId: 300,
  269. id: 302,
  270. menuType: 0,
  271. title: "menus.pureRole"
  272. },
  273. {
  274. parentId: 300,
  275. id: 303,
  276. menuType: 0,
  277. title: "menus.pureSystemMenu"
  278. },
  279. {
  280. parentId: 300,
  281. id: 304,
  282. menuType: 0,
  283. title: "menus.pureDept"
  284. },
  285. // 系统监控
  286. {
  287. parentId: 0,
  288. id: 400,
  289. menuType: 0,
  290. title: "menus.pureSysMonitor"
  291. },
  292. {
  293. parentId: 400,
  294. id: 401,
  295. menuType: 0,
  296. title: "menus.pureOnlineUser"
  297. },
  298. {
  299. parentId: 400,
  300. id: 402,
  301. menuType: 0,
  302. title: "menus.pureLoginLog"
  303. },
  304. {
  305. parentId: 400,
  306. id: 403,
  307. menuType: 0,
  308. title: "menus.pureOperationLog"
  309. },
  310. {
  311. parentId: 400,
  312. id: 404,
  313. menuType: 0,
  314. title: "menus.pureSystemLog"
  315. },
  316. // 标签页操作
  317. {
  318. parentId: 0,
  319. id: 500,
  320. menuType: 0,
  321. title: "menus.pureTabs"
  322. },
  323. {
  324. parentId: 500,
  325. id: 501,
  326. menuType: 0,
  327. title: "menus.pureTabs"
  328. },
  329. {
  330. parentId: 500,
  331. id: 502,
  332. menuType: 0,
  333. title: "query传参模式"
  334. },
  335. {
  336. parentId: 500,
  337. id: 503,
  338. menuType: 0,
  339. title: "params传参模式"
  340. }
  341. ]
  342. };
  343. }
  344. },
  345. // 角色管理-权限-菜单权限-根据角色 id 查对应菜单
  346. {
  347. url: "/role-menu-ids",
  348. method: "post",
  349. response: ({ body }) => {
  350. if (body.id == 1) {
  351. return {
  352. success: true,
  353. data: [
  354. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
  355. 202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
  356. 404, 500, 501, 502, 503
  357. ]
  358. };
  359. } else if (body.id == 2) {
  360. return {
  361. success: true,
  362. data: [
  363. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
  364. 501, 502, 503
  365. ]
  366. };
  367. }
  368. }
  369. },
  370. // 菜单管理
  371. {
  372. url: "/menu",
  373. method: "post",
  374. response: () => {
  375. return {
  376. success: true,
  377. data: [
  378. // 外部页面
  379. {
  380. parentId: 0,
  381. id: 100,
  382. menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
  383. title: "menus.pureExternalPage",
  384. name: "PureIframe",
  385. path: "/iframe",
  386. component: "",
  387. rank: 7,
  388. redirect: "",
  389. icon: "ri:links-fill",
  390. extraIcon: "",
  391. enterTransition: "",
  392. leaveTransition: "",
  393. activePath: "",
  394. auths: "",
  395. frameSrc: "",
  396. frameLoading: true,
  397. keepAlive: false,
  398. hiddenTag: false,
  399. fixedTag: false,
  400. showLink: true,
  401. showParent: false
  402. },
  403. {
  404. parentId: 100,
  405. id: 101,
  406. menuType: 0,
  407. title: "menus.pureExternalDoc",
  408. name: "PureIframeExternal",
  409. path: "/iframe/external",
  410. component: "",
  411. rank: null,
  412. redirect: "",
  413. icon: "",
  414. extraIcon: "",
  415. enterTransition: "",
  416. leaveTransition: "",
  417. activePath: "",
  418. auths: "",
  419. frameSrc: "",
  420. frameLoading: true,
  421. keepAlive: false,
  422. hiddenTag: false,
  423. fixedTag: false,
  424. showLink: true,
  425. showParent: false
  426. },
  427. {
  428. parentId: 101,
  429. id: 102,
  430. menuType: 2,
  431. title: "menus.pureExternalLink",
  432. name: "https://pure-admin.cn/",
  433. path: "/external",
  434. component: "",
  435. rank: null,
  436. redirect: "",
  437. icon: "",
  438. extraIcon: "",
  439. enterTransition: "",
  440. leaveTransition: "",
  441. activePath: "",
  442. auths: "",
  443. frameSrc: "",
  444. frameLoading: true,
  445. keepAlive: false,
  446. hiddenTag: false,
  447. fixedTag: false,
  448. showLink: true,
  449. showParent: false
  450. },
  451. {
  452. parentId: 101,
  453. id: 103,
  454. menuType: 2,
  455. title: "menus.pureUtilsLink",
  456. name: "https://pure-admin-utils.netlify.app/",
  457. path: "/pureUtilsLink",
  458. component: "",
  459. rank: null,
  460. redirect: "",
  461. icon: "",
  462. extraIcon: "",
  463. enterTransition: "",
  464. leaveTransition: "",
  465. activePath: "",
  466. auths: "",
  467. frameSrc: "",
  468. frameLoading: true,
  469. keepAlive: false,
  470. hiddenTag: false,
  471. fixedTag: false,
  472. showLink: true,
  473. showParent: false
  474. },
  475. {
  476. parentId: 100,
  477. id: 104,
  478. menuType: 1,
  479. title: "menus.pureEmbeddedDoc",
  480. name: "PureIframeEmbedded",
  481. path: "/iframe/embedded",
  482. component: "",
  483. rank: null,
  484. redirect: "",
  485. icon: "",
  486. extraIcon: "",
  487. enterTransition: "",
  488. leaveTransition: "",
  489. activePath: "",
  490. auths: "",
  491. frameSrc: "",
  492. frameLoading: true,
  493. keepAlive: false,
  494. hiddenTag: false,
  495. fixedTag: false,
  496. showLink: true,
  497. showParent: false
  498. },
  499. {
  500. parentId: 104,
  501. id: 105,
  502. menuType: 1,
  503. title: "menus.pureEpDoc",
  504. name: "FrameEp",
  505. path: "/iframe/ep",
  506. component: "",
  507. rank: null,
  508. redirect: "",
  509. icon: "",
  510. extraIcon: "",
  511. enterTransition: "",
  512. leaveTransition: "",
  513. activePath: "",
  514. auths: "",
  515. frameSrc: "https://element-plus.org/zh-CN/",
  516. frameLoading: true,
  517. keepAlive: true,
  518. hiddenTag: false,
  519. fixedTag: false,
  520. showLink: true,
  521. showParent: false
  522. },
  523. {
  524. parentId: 104,
  525. id: 106,
  526. menuType: 1,
  527. title: "menus.pureTailwindcssDoc",
  528. name: "FrameTailwindcss",
  529. path: "/iframe/tailwindcss",
  530. component: "",
  531. rank: null,
  532. redirect: "",
  533. icon: "",
  534. extraIcon: "",
  535. enterTransition: "",
  536. leaveTransition: "",
  537. activePath: "",
  538. auths: "",
  539. frameSrc: "https://tailwindcss.com/docs/installation",
  540. frameLoading: true,
  541. keepAlive: true,
  542. hiddenTag: false,
  543. fixedTag: false,
  544. showLink: true,
  545. showParent: false
  546. },
  547. {
  548. parentId: 104,
  549. id: 107,
  550. menuType: 1,
  551. title: "menus.pureVueDoc",
  552. name: "FrameVue",
  553. path: "/iframe/vue3",
  554. component: "",
  555. rank: null,
  556. redirect: "",
  557. icon: "",
  558. extraIcon: "",
  559. enterTransition: "",
  560. leaveTransition: "",
  561. activePath: "",
  562. auths: "",
  563. frameSrc: "https://cn.vuejs.org/",
  564. frameLoading: true,
  565. keepAlive: true,
  566. hiddenTag: false,
  567. fixedTag: false,
  568. showLink: true,
  569. showParent: false
  570. },
  571. {
  572. parentId: 104,
  573. id: 108,
  574. menuType: 1,
  575. title: "menus.pureViteDoc",
  576. name: "FrameVite",
  577. path: "/iframe/vite",
  578. component: "",
  579. rank: null,
  580. redirect: "",
  581. icon: "",
  582. extraIcon: "",
  583. enterTransition: "",
  584. leaveTransition: "",
  585. activePath: "",
  586. auths: "",
  587. frameSrc: "https://cn.vitejs.dev/",
  588. frameLoading: true,
  589. keepAlive: true,
  590. hiddenTag: false,
  591. fixedTag: false,
  592. showLink: true,
  593. showParent: false
  594. },
  595. {
  596. parentId: 104,
  597. id: 109,
  598. menuType: 1,
  599. title: "menus.purePiniaDoc",
  600. name: "FramePinia",
  601. path: "/iframe/pinia",
  602. component: "",
  603. rank: null,
  604. redirect: "",
  605. icon: "",
  606. extraIcon: "",
  607. enterTransition: "",
  608. leaveTransition: "",
  609. activePath: "",
  610. auths: "",
  611. frameSrc: "https://pinia.vuejs.org/zh/index.html",
  612. frameLoading: true,
  613. keepAlive: true,
  614. hiddenTag: false,
  615. fixedTag: false,
  616. showLink: true,
  617. showParent: false
  618. },
  619. {
  620. parentId: 104,
  621. id: 110,
  622. menuType: 1,
  623. title: "menus.pureRouterDoc",
  624. name: "FrameRouter",
  625. path: "/iframe/vue-router",
  626. component: "",
  627. rank: null,
  628. redirect: "",
  629. icon: "",
  630. extraIcon: "",
  631. enterTransition: "",
  632. leaveTransition: "",
  633. activePath: "",
  634. auths: "",
  635. frameSrc: "https://router.vuejs.org/zh/",
  636. frameLoading: true,
  637. keepAlive: true,
  638. hiddenTag: false,
  639. fixedTag: false,
  640. showLink: true,
  641. showParent: false
  642. },
  643. // 权限管理
  644. {
  645. parentId: 0,
  646. id: 200,
  647. menuType: 0,
  648. title: "menus.purePermission",
  649. name: "PurePermission",
  650. path: "/permission",
  651. component: "",
  652. rank: 9,
  653. redirect: "",
  654. icon: "ep:lollipop",
  655. extraIcon: "",
  656. enterTransition: "",
  657. leaveTransition: "",
  658. activePath: "",
  659. auths: "",
  660. frameSrc: "",
  661. frameLoading: true,
  662. keepAlive: false,
  663. hiddenTag: false,
  664. fixedTag: false,
  665. showLink: true,
  666. showParent: false
  667. },
  668. {
  669. parentId: 200,
  670. id: 201,
  671. menuType: 0,
  672. title: "menus.purePermissionPage",
  673. name: "PermissionPage",
  674. path: "/permission/page/index",
  675. component: "",
  676. rank: null,
  677. redirect: "",
  678. icon: "",
  679. extraIcon: "",
  680. enterTransition: "",
  681. leaveTransition: "",
  682. activePath: "",
  683. auths: "",
  684. frameSrc: "",
  685. frameLoading: true,
  686. keepAlive: false,
  687. hiddenTag: false,
  688. fixedTag: false,
  689. showLink: true,
  690. showParent: false
  691. },
  692. {
  693. parentId: 200,
  694. id: 202,
  695. menuType: 0,
  696. title: "menus.purePermissionButton",
  697. name: "PermissionButton",
  698. path: "/permission/button",
  699. component: "",
  700. rank: null,
  701. redirect: "",
  702. icon: "",
  703. extraIcon: "",
  704. enterTransition: "",
  705. leaveTransition: "",
  706. activePath: "",
  707. auths: "",
  708. frameSrc: "",
  709. frameLoading: true,
  710. keepAlive: false,
  711. hiddenTag: false,
  712. fixedTag: false,
  713. showLink: true,
  714. showParent: false
  715. },
  716. {
  717. parentId: 202,
  718. id: 203,
  719. menuType: 0,
  720. title: "menus.purePermissionButtonRouter",
  721. name: "PermissionButtonRouter",
  722. path: "/permission/button/router",
  723. component: "permission/button/index",
  724. rank: null,
  725. redirect: "",
  726. icon: "",
  727. extraIcon: "",
  728. enterTransition: "",
  729. leaveTransition: "",
  730. activePath: "",
  731. auths: "",
  732. frameSrc: "",
  733. frameLoading: true,
  734. keepAlive: false,
  735. hiddenTag: false,
  736. fixedTag: false,
  737. showLink: true,
  738. showParent: false
  739. },
  740. {
  741. parentId: 203,
  742. id: 210,
  743. menuType: 3,
  744. title: "添加",
  745. name: "",
  746. path: "",
  747. component: "",
  748. rank: null,
  749. redirect: "",
  750. icon: "",
  751. extraIcon: "",
  752. enterTransition: "",
  753. leaveTransition: "",
  754. activePath: "",
  755. auths: "permission:btn:add",
  756. frameSrc: "",
  757. frameLoading: true,
  758. keepAlive: false,
  759. hiddenTag: false,
  760. fixedTag: false,
  761. showLink: true,
  762. showParent: false
  763. },
  764. {
  765. parentId: 203,
  766. id: 211,
  767. menuType: 3,
  768. title: "修改",
  769. name: "",
  770. path: "",
  771. component: "",
  772. rank: null,
  773. redirect: "",
  774. icon: "",
  775. extraIcon: "",
  776. enterTransition: "",
  777. leaveTransition: "",
  778. activePath: "",
  779. auths: "permission:btn:edit",
  780. frameSrc: "",
  781. frameLoading: true,
  782. keepAlive: false,
  783. hiddenTag: false,
  784. fixedTag: false,
  785. showLink: true,
  786. showParent: false
  787. },
  788. {
  789. parentId: 203,
  790. id: 212,
  791. menuType: 3,
  792. title: "删除",
  793. name: "",
  794. path: "",
  795. component: "",
  796. rank: null,
  797. redirect: "",
  798. icon: "",
  799. extraIcon: "",
  800. enterTransition: "",
  801. leaveTransition: "",
  802. activePath: "",
  803. auths: "permission:btn:delete",
  804. frameSrc: "",
  805. frameLoading: true,
  806. keepAlive: false,
  807. hiddenTag: false,
  808. fixedTag: false,
  809. showLink: true,
  810. showParent: false
  811. },
  812. {
  813. parentId: 202,
  814. id: 204,
  815. menuType: 0,
  816. title: "menus.purePermissionButtonLogin",
  817. name: "PermissionButtonLogin",
  818. path: "/permission/button/login",
  819. component: "permission/button/perms",
  820. rank: null,
  821. redirect: "",
  822. icon: "",
  823. extraIcon: "",
  824. enterTransition: "",
  825. leaveTransition: "",
  826. activePath: "",
  827. auths: "",
  828. frameSrc: "",
  829. frameLoading: true,
  830. keepAlive: false,
  831. hiddenTag: false,
  832. fixedTag: false,
  833. showLink: true,
  834. showParent: false
  835. },
  836. {
  837. parentId: 204,
  838. id: 220,
  839. menuType: 3,
  840. title: "添加",
  841. name: "",
  842. path: "",
  843. component: "",
  844. rank: null,
  845. redirect: "",
  846. icon: "",
  847. extraIcon: "",
  848. enterTransition: "",
  849. leaveTransition: "",
  850. activePath: "",
  851. auths: "permission:btn:add",
  852. frameSrc: "",
  853. frameLoading: true,
  854. keepAlive: false,
  855. hiddenTag: false,
  856. fixedTag: false,
  857. showLink: true,
  858. showParent: false
  859. },
  860. {
  861. parentId: 204,
  862. id: 221,
  863. menuType: 3,
  864. title: "修改",
  865. name: "",
  866. path: "",
  867. component: "",
  868. rank: null,
  869. redirect: "",
  870. icon: "",
  871. extraIcon: "",
  872. enterTransition: "",
  873. leaveTransition: "",
  874. activePath: "",
  875. auths: "permission:btn:edit",
  876. frameSrc: "",
  877. frameLoading: true,
  878. keepAlive: false,
  879. hiddenTag: false,
  880. fixedTag: false,
  881. showLink: true,
  882. showParent: false
  883. },
  884. {
  885. parentId: 204,
  886. id: 222,
  887. menuType: 3,
  888. title: "删除",
  889. name: "",
  890. path: "",
  891. component: "",
  892. rank: null,
  893. redirect: "",
  894. icon: "",
  895. extraIcon: "",
  896. enterTransition: "",
  897. leaveTransition: "",
  898. activePath: "",
  899. auths: "permission:btn:delete",
  900. frameSrc: "",
  901. frameLoading: true,
  902. keepAlive: false,
  903. hiddenTag: false,
  904. fixedTag: false,
  905. showLink: true,
  906. showParent: false
  907. },
  908. // 系统管理
  909. {
  910. parentId: 0,
  911. id: 300,
  912. menuType: 0,
  913. title: "menus.pureSysManagement",
  914. name: "PureSystem",
  915. path: "/system",
  916. component: "",
  917. rank: 10,
  918. redirect: "",
  919. icon: "ri:settings-3-line",
  920. extraIcon: "",
  921. enterTransition: "",
  922. leaveTransition: "",
  923. activePath: "",
  924. auths: "",
  925. frameSrc: "",
  926. frameLoading: true,
  927. keepAlive: false,
  928. hiddenTag: false,
  929. fixedTag: false,
  930. showLink: true,
  931. showParent: false
  932. },
  933. {
  934. parentId: 300,
  935. id: 301,
  936. menuType: 0,
  937. title: "menus.pureUser",
  938. name: "SystemUser",
  939. path: "/system/user/index",
  940. component: "",
  941. rank: null,
  942. redirect: "",
  943. icon: "ri:admin-line",
  944. extraIcon: "",
  945. enterTransition: "",
  946. leaveTransition: "",
  947. activePath: "",
  948. auths: "",
  949. frameSrc: "",
  950. frameLoading: true,
  951. keepAlive: false,
  952. hiddenTag: false,
  953. fixedTag: false,
  954. showLink: true,
  955. showParent: false
  956. },
  957. {
  958. parentId: 300,
  959. id: 302,
  960. menuType: 0,
  961. title: "menus.pureRole",
  962. name: "SystemRole",
  963. path: "/system/role/index",
  964. component: "",
  965. rank: null,
  966. redirect: "",
  967. icon: "ri:admin-fill",
  968. extraIcon: "",
  969. enterTransition: "",
  970. leaveTransition: "",
  971. activePath: "",
  972. auths: "",
  973. frameSrc: "",
  974. frameLoading: true,
  975. keepAlive: false,
  976. hiddenTag: false,
  977. fixedTag: false,
  978. showLink: true,
  979. showParent: false
  980. },
  981. {
  982. parentId: 300,
  983. id: 303,
  984. menuType: 0,
  985. title: "menus.pureSystemMenu",
  986. name: "SystemMenu",
  987. path: "/system/menu/index",
  988. component: "",
  989. rank: null,
  990. redirect: "",
  991. icon: "ep:menu",
  992. extraIcon: "",
  993. enterTransition: "",
  994. leaveTransition: "",
  995. activePath: "",
  996. auths: "",
  997. frameSrc: "",
  998. frameLoading: true,
  999. keepAlive: false,
  1000. hiddenTag: false,
  1001. fixedTag: false,
  1002. showLink: true,
  1003. showParent: false
  1004. },
  1005. {
  1006. parentId: 300,
  1007. id: 304,
  1008. menuType: 0,
  1009. title: "menus.pureDept",
  1010. name: "SystemDept",
  1011. path: "/system/dept/index",
  1012. component: "",
  1013. rank: null,
  1014. redirect: "",
  1015. icon: "ri:git-branch-line",
  1016. extraIcon: "",
  1017. enterTransition: "",
  1018. leaveTransition: "",
  1019. activePath: "",
  1020. auths: "",
  1021. frameSrc: "",
  1022. frameLoading: true,
  1023. keepAlive: false,
  1024. hiddenTag: false,
  1025. fixedTag: false,
  1026. showLink: true,
  1027. showParent: false
  1028. },
  1029. // 系统监控
  1030. {
  1031. parentId: 0,
  1032. id: 400,
  1033. menuType: 0,
  1034. title: "menus.pureSysMonitor",
  1035. name: "PureMonitor",
  1036. path: "/monitor",
  1037. component: "",
  1038. rank: 11,
  1039. redirect: "",
  1040. icon: "ep:monitor",
  1041. extraIcon: "",
  1042. enterTransition: "",
  1043. leaveTransition: "",
  1044. activePath: "",
  1045. auths: "",
  1046. frameSrc: "",
  1047. frameLoading: true,
  1048. keepAlive: false,
  1049. hiddenTag: false,
  1050. fixedTag: false,
  1051. showLink: true,
  1052. showParent: false
  1053. },
  1054. {
  1055. parentId: 400,
  1056. id: 401,
  1057. menuType: 0,
  1058. title: "menus.pureOnlineUser",
  1059. name: "OnlineUser",
  1060. path: "/monitor/online-user",
  1061. component: "monitor/online/index",
  1062. rank: null,
  1063. redirect: "",
  1064. icon: "ri:user-voice-line",
  1065. extraIcon: "",
  1066. enterTransition: "",
  1067. leaveTransition: "",
  1068. activePath: "",
  1069. auths: "",
  1070. frameSrc: "",
  1071. frameLoading: true,
  1072. keepAlive: false,
  1073. hiddenTag: false,
  1074. fixedTag: false,
  1075. showLink: true,
  1076. showParent: false
  1077. },
  1078. {
  1079. parentId: 400,
  1080. id: 402,
  1081. menuType: 0,
  1082. title: "menus.pureLoginLog",
  1083. name: "LoginLog",
  1084. path: "/monitor/login-logs",
  1085. component: "monitor/logs/login/index",
  1086. rank: null,
  1087. redirect: "",
  1088. icon: "ri:window-line",
  1089. extraIcon: "",
  1090. enterTransition: "",
  1091. leaveTransition: "",
  1092. activePath: "",
  1093. auths: "",
  1094. frameSrc: "",
  1095. frameLoading: true,
  1096. keepAlive: false,
  1097. hiddenTag: false,
  1098. fixedTag: false,
  1099. showLink: true,
  1100. showParent: false
  1101. },
  1102. {
  1103. parentId: 400,
  1104. id: 403,
  1105. menuType: 0,
  1106. title: "menus.pureOperationLog",
  1107. name: "OperationLog",
  1108. path: "/monitor/operation-logs",
  1109. component: "monitor/logs/operation/index",
  1110. rank: null,
  1111. redirect: "",
  1112. icon: "ri:history-fill",
  1113. extraIcon: "",
  1114. enterTransition: "",
  1115. leaveTransition: "",
  1116. activePath: "",
  1117. auths: "",
  1118. frameSrc: "",
  1119. frameLoading: true,
  1120. keepAlive: false,
  1121. hiddenTag: false,
  1122. fixedTag: false,
  1123. showLink: true,
  1124. showParent: false
  1125. },
  1126. {
  1127. parentId: 400,
  1128. id: 404,
  1129. menuType: 0,
  1130. title: "menus.pureSystemLog",
  1131. name: "SystemLog",
  1132. path: "/monitor/system-logs",
  1133. component: "monitor/logs/system/index",
  1134. rank: null,
  1135. redirect: "",
  1136. icon: "ri:file-search-line",
  1137. extraIcon: "",
  1138. enterTransition: "",
  1139. leaveTransition: "",
  1140. activePath: "",
  1141. auths: "",
  1142. frameSrc: "",
  1143. frameLoading: true,
  1144. keepAlive: false,
  1145. hiddenTag: false,
  1146. fixedTag: false,
  1147. showLink: true,
  1148. showParent: false
  1149. },
  1150. // 标签页操作
  1151. {
  1152. parentId: 0,
  1153. id: 500,
  1154. menuType: 0,
  1155. title: "menus.pureTabs",
  1156. name: "PureTabs",
  1157. path: "/tabs",
  1158. component: "",
  1159. rank: 12,
  1160. redirect: "",
  1161. icon: "ri:bookmark-2-line",
  1162. extraIcon: "",
  1163. enterTransition: "",
  1164. leaveTransition: "",
  1165. activePath: "",
  1166. auths: "",
  1167. frameSrc: "",
  1168. frameLoading: true,
  1169. keepAlive: false,
  1170. hiddenTag: false,
  1171. fixedTag: false,
  1172. showLink: true,
  1173. showParent: false
  1174. },
  1175. {
  1176. parentId: 500,
  1177. id: 501,
  1178. menuType: 0,
  1179. title: "menus.pureTabs",
  1180. name: "Tabs",
  1181. path: "/tabs/index",
  1182. component: "",
  1183. rank: null,
  1184. redirect: "",
  1185. icon: "",
  1186. extraIcon: "",
  1187. enterTransition: "",
  1188. leaveTransition: "",
  1189. activePath: "",
  1190. auths: "",
  1191. frameSrc: "",
  1192. frameLoading: true,
  1193. keepAlive: false,
  1194. hiddenTag: false,
  1195. fixedTag: false,
  1196. showLink: true,
  1197. showParent: false
  1198. },
  1199. {
  1200. parentId: 500,
  1201. id: 502,
  1202. menuType: 0,
  1203. title: "query传参模式",
  1204. name: "TabQueryDetail",
  1205. path: "/tabs/query-detail",
  1206. component: "",
  1207. rank: null,
  1208. redirect: "",
  1209. icon: "",
  1210. extraIcon: "",
  1211. enterTransition: "",
  1212. leaveTransition: "",
  1213. activePath: "/tabs/index",
  1214. auths: "",
  1215. frameSrc: "",
  1216. frameLoading: true,
  1217. keepAlive: false,
  1218. hiddenTag: false,
  1219. fixedTag: false,
  1220. showLink: false,
  1221. showParent: false
  1222. },
  1223. {
  1224. parentId: 500,
  1225. id: 503,
  1226. menuType: 0,
  1227. title: "params传参模式",
  1228. name: "TabParamsDetail",
  1229. path: "/tabs/params-detail/:id",
  1230. component: "params-detail",
  1231. rank: null,
  1232. redirect: "",
  1233. icon: "",
  1234. extraIcon: "",
  1235. enterTransition: "",
  1236. leaveTransition: "",
  1237. activePath: "/tabs/index",
  1238. auths: "",
  1239. frameSrc: "",
  1240. frameLoading: true,
  1241. keepAlive: false,
  1242. hiddenTag: false,
  1243. fixedTag: false,
  1244. showLink: false,
  1245. showParent: false
  1246. }
  1247. ]
  1248. };
  1249. }
  1250. },
  1251. // 部门管理
  1252. {
  1253. url: "/dept",
  1254. method: "post",
  1255. response: () => {
  1256. return {
  1257. success: true,
  1258. data: [
  1259. {
  1260. name: "杭州总公司",
  1261. parentId: 0,
  1262. id: 100,
  1263. sort: 0,
  1264. phone: "15888888888",
  1265. principal: faker.person.firstName(),
  1266. email: faker.internet.email(),
  1267. status: 1, // 状态 1 启用 0 停用
  1268. type: 1, // 1 公司 2 分公司 3 部门
  1269. createTime: 1605456000000,
  1270. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1271. },
  1272. {
  1273. name: "郑州分公司",
  1274. parentId: 100,
  1275. id: 101,
  1276. sort: 1,
  1277. phone: "15888888888",
  1278. principal: faker.person.firstName(),
  1279. email: faker.internet.email(),
  1280. status: 1,
  1281. type: 2,
  1282. createTime: 1605456000000,
  1283. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1284. },
  1285. {
  1286. name: "研发部门",
  1287. parentId: 101,
  1288. id: 103,
  1289. sort: 1,
  1290. phone: "15888888888",
  1291. principal: faker.person.firstName(),
  1292. email: faker.internet.email(),
  1293. status: 1,
  1294. type: 3,
  1295. createTime: 1605456000000,
  1296. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1297. },
  1298. {
  1299. name: "市场部门",
  1300. parentId: 102,
  1301. id: 108,
  1302. sort: 1,
  1303. phone: "15888888888",
  1304. principal: faker.person.firstName(),
  1305. email: faker.internet.email(),
  1306. status: 1,
  1307. type: 3,
  1308. createTime: 1605456000000,
  1309. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1310. },
  1311. {
  1312. name: "深圳分公司",
  1313. parentId: 100,
  1314. id: 102,
  1315. sort: 2,
  1316. phone: "15888888888",
  1317. principal: faker.person.firstName(),
  1318. email: faker.internet.email(),
  1319. status: 1,
  1320. type: 2,
  1321. createTime: 1605456000000,
  1322. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1323. },
  1324. {
  1325. name: "市场部门",
  1326. parentId: 101,
  1327. id: 104,
  1328. sort: 2,
  1329. phone: "15888888888",
  1330. principal: faker.person.firstName(),
  1331. email: faker.internet.email(),
  1332. status: 1,
  1333. type: 3,
  1334. createTime: 1605456000000,
  1335. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1336. },
  1337. {
  1338. name: "财务部门",
  1339. parentId: 102,
  1340. id: 109,
  1341. sort: 2,
  1342. phone: "15888888888",
  1343. principal: faker.person.firstName(),
  1344. email: faker.internet.email(),
  1345. status: 1,
  1346. type: 3,
  1347. createTime: 1605456000000,
  1348. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1349. },
  1350. {
  1351. name: "测试部门",
  1352. parentId: 101,
  1353. id: 105,
  1354. sort: 3,
  1355. phone: "15888888888",
  1356. principal: faker.person.firstName(),
  1357. email: faker.internet.email(),
  1358. status: 0,
  1359. type: 3,
  1360. createTime: 1605456000000,
  1361. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1362. },
  1363. {
  1364. name: "财务部门",
  1365. parentId: 101,
  1366. id: 106,
  1367. sort: 4,
  1368. phone: "15888888888",
  1369. principal: faker.person.firstName(),
  1370. email: faker.internet.email(),
  1371. status: 1,
  1372. type: 3,
  1373. createTime: 1605456000000,
  1374. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1375. },
  1376. {
  1377. name: "运维部门",
  1378. parentId: 101,
  1379. id: 107,
  1380. sort: 5,
  1381. phone: "15888888888",
  1382. principal: faker.person.firstName(),
  1383. email: faker.internet.email(),
  1384. status: 0,
  1385. type: 3,
  1386. createTime: 1605456000000,
  1387. remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
  1388. }
  1389. ]
  1390. };
  1391. }
  1392. },
  1393. // 在线用户
  1394. {
  1395. url: "/online-logs",
  1396. method: "post",
  1397. response: ({ body }) => {
  1398. let list = [
  1399. {
  1400. id: 1,
  1401. username: "admin",
  1402. ip: faker.internet.ipv4(),
  1403. address: "中国河南省信阳市",
  1404. system: "macOS",
  1405. browser: "Chrome",
  1406. loginTime: new Date()
  1407. },
  1408. {
  1409. id: 2,
  1410. username: "common",
  1411. ip: faker.internet.ipv4(),
  1412. address: "中国广东省深圳市",
  1413. system: "Windows",
  1414. browser: "Firefox",
  1415. loginTime: new Date()
  1416. }
  1417. ];
  1418. list = list.filter(item => item.username.includes(body?.username));
  1419. return {
  1420. success: true,
  1421. data: {
  1422. list,
  1423. total: list.length, // 总条目数
  1424. pageSize: 10, // 每页显示条目个数
  1425. currentPage: 1 // 当前页数
  1426. }
  1427. };
  1428. }
  1429. },
  1430. // 登录日志
  1431. {
  1432. url: "/login-logs",
  1433. method: "post",
  1434. response: ({ body }) => {
  1435. let list = [
  1436. {
  1437. id: 1,
  1438. username: "admin",
  1439. ip: faker.internet.ipv4(),
  1440. address: "中国河南省信阳市",
  1441. system: "macOS",
  1442. browser: "Chrome",
  1443. status: 1, // 登录状态 1 成功 0 失败
  1444. behavior: "账号登录",
  1445. loginTime: new Date()
  1446. },
  1447. {
  1448. id: 2,
  1449. username: "common",
  1450. ip: faker.internet.ipv4(),
  1451. address: "中国广东省深圳市",
  1452. system: "Windows",
  1453. browser: "Firefox",
  1454. status: 0,
  1455. behavior: "第三方登录",
  1456. loginTime: new Date()
  1457. }
  1458. ];
  1459. list = list.filter(item => item.username.includes(body?.username));
  1460. list = list.filter(item =>
  1461. String(item.status).includes(String(body?.status))
  1462. );
  1463. return {
  1464. success: true,
  1465. data: {
  1466. list,
  1467. total: list.length, // 总条目数
  1468. pageSize: 10, // 每页显示条目个数
  1469. currentPage: 1 // 当前页数
  1470. }
  1471. };
  1472. }
  1473. },
  1474. // 操作日志
  1475. {
  1476. url: "/operation-logs",
  1477. method: "post",
  1478. response: ({ body }) => {
  1479. let list = [
  1480. {
  1481. id: 1,
  1482. username: "admin",
  1483. ip: faker.internet.ipv4(),
  1484. address: "中国河南省信阳市",
  1485. system: "macOS",
  1486. browser: "Chrome",
  1487. status: 1, // 操作状态 1 成功 0 失败
  1488. summary: "菜单管理-添加菜单", // 操作概要
  1489. module: "系统管理", // 所属模块
  1490. operatingTime: new Date() // 操作时间
  1491. },
  1492. {
  1493. id: 2,
  1494. username: "common",
  1495. ip: faker.internet.ipv4(),
  1496. address: "中国广东省深圳市",
  1497. system: "Windows",
  1498. browser: "Firefox",
  1499. status: 0,
  1500. summary: "列表分页查询",
  1501. module: "在线用户",
  1502. operatingTime: new Date()
  1503. }
  1504. ];
  1505. list = list.filter(item => item.module.includes(body?.module));
  1506. list = list.filter(item =>
  1507. String(item.status).includes(String(body?.status))
  1508. );
  1509. return {
  1510. success: true,
  1511. data: {
  1512. list,
  1513. total: list.length, // 总条目数
  1514. pageSize: 10, // 每页显示条目个数
  1515. currentPage: 1 // 当前页数
  1516. }
  1517. };
  1518. }
  1519. },
  1520. // 系统日志
  1521. {
  1522. url: "/system-logs",
  1523. method: "post",
  1524. response: ({ body }) => {
  1525. let list = [
  1526. {
  1527. id: 1, // 日志ID
  1528. /**
  1529. * 日志级别
  1530. * 0 debug调试(最低级别的日志,用于调试和开发阶段)
  1531. * 1 info信息(默认级别,用于记录一般的信息)
  1532. * 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行)
  1533. * 3 error错误(表示发生了错误,但不会导致系统崩溃)
  1534. * 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行)
  1535. */
  1536. level: 1,
  1537. module: "菜单管理", // 所属模块
  1538. url: "/menu", // 请求接口
  1539. method: "post", // 请求方法
  1540. ip: faker.internet.ipv4(),
  1541. address: "中国河南省信阳市",
  1542. system: "macOS",
  1543. browser: "Chrome",
  1544. /**
  1545. * 请求耗时(单位:ms 毫秒)
  1546. * 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常
  1547. * 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断
  1548. */
  1549. takesTime: 10,
  1550. requestTime: new Date() // 请求时间
  1551. },
  1552. {
  1553. id: 2,
  1554. level: 0,
  1555. module: "地图",
  1556. url: "/get-map-info",
  1557. method: "get",
  1558. ip: faker.internet.ipv4(),
  1559. address: "中国广东省深圳市",
  1560. system: "Windows",
  1561. browser: "Firefox",
  1562. takesTime: 1200,
  1563. requestTime: new Date()
  1564. }
  1565. ];
  1566. list = list.filter(item => item.module.includes(body?.module));
  1567. return {
  1568. success: true,
  1569. data: {
  1570. list,
  1571. total: list.length, // 总条目数
  1572. pageSize: 10, // 每页显示条目个数
  1573. currentPage: 1 // 当前页数
  1574. }
  1575. };
  1576. }
  1577. },
  1578. // 系统日志-根据 id 查日志详情
  1579. {
  1580. url: "/system-logs-detail",
  1581. method: "post",
  1582. response: ({ body }) => {
  1583. if (body.id == 1) {
  1584. return {
  1585. id: 1,
  1586. level: 1,
  1587. module: "菜单管理",
  1588. url: "/menu",
  1589. method: "post",
  1590. ip: faker.internet.ipv4(),
  1591. address: "中国河南省信阳市",
  1592. system: "macOS",
  1593. browser: "Chrome",
  1594. takesTime: 10,
  1595. responseHeaders: {
  1596. traceId: "1495502411171032",
  1597. "Content-Type": "application/json",
  1598. Connection: "keep-alive",
  1599. "Keep-Alive": "timeout=5",
  1600. "Content-Length": 17019
  1601. },
  1602. responseBody: {
  1603. success: true,
  1604. data: [
  1605. {
  1606. parentId: 0,
  1607. id: 400,
  1608. menuType: 0,
  1609. title: "menus.pureSysMonitor",
  1610. name: "PureMonitor",
  1611. path: "/monitor",
  1612. component: "",
  1613. rank: 11,
  1614. redirect: "",
  1615. icon: "ep:monitor",
  1616. extraIcon: "",
  1617. enterTransition: "",
  1618. leaveTransition: "",
  1619. activePath: "",
  1620. auths: "",
  1621. frameSrc: "",
  1622. frameLoading: true,
  1623. keepAlive: false,
  1624. hiddenTag: false,
  1625. fixedTag: false,
  1626. showLink: true,
  1627. showParent: false
  1628. },
  1629. {
  1630. parentId: 400,
  1631. id: 401,
  1632. menuType: 0,
  1633. title: "menus.pureOnlineUser",
  1634. name: "OnlineUser",
  1635. path: "/monitor/online-user",
  1636. component: "monitor/online/index",
  1637. rank: null,
  1638. redirect: "",
  1639. icon: "ri:user-voice-line",
  1640. extraIcon: "",
  1641. enterTransition: "",
  1642. leaveTransition: "",
  1643. activePath: "",
  1644. auths: "",
  1645. frameSrc: "",
  1646. frameLoading: true,
  1647. keepAlive: false,
  1648. hiddenTag: false,
  1649. fixedTag: false,
  1650. showLink: true,
  1651. showParent: false
  1652. },
  1653. {
  1654. parentId: 400,
  1655. id: 402,
  1656. menuType: 0,
  1657. title: "menus.pureLoginLog",
  1658. name: "LoginLog",
  1659. path: "/monitor/login-logs",
  1660. component: "monitor/logs/login/index",
  1661. rank: null,
  1662. redirect: "",
  1663. icon: "ri:window-line",
  1664. extraIcon: "",
  1665. enterTransition: "",
  1666. leaveTransition: "",
  1667. activePath: "",
  1668. auths: "",
  1669. frameSrc: "",
  1670. frameLoading: true,
  1671. keepAlive: false,
  1672. hiddenTag: false,
  1673. fixedTag: false,
  1674. showLink: true,
  1675. showParent: false
  1676. },
  1677. {
  1678. parentId: 400,
  1679. id: 403,
  1680. menuType: 0,
  1681. title: "menus.pureOperationLog",
  1682. name: "OperationLog",
  1683. path: "/monitor/operation-logs",
  1684. component: "monitor/logs/operation/index",
  1685. rank: null,
  1686. redirect: "",
  1687. icon: "ri:history-fill",
  1688. extraIcon: "",
  1689. enterTransition: "",
  1690. leaveTransition: "",
  1691. activePath: "",
  1692. auths: "",
  1693. frameSrc: "",
  1694. frameLoading: true,
  1695. keepAlive: false,
  1696. hiddenTag: false,
  1697. fixedTag: false,
  1698. showLink: true,
  1699. showParent: false
  1700. },
  1701. {
  1702. parentId: 400,
  1703. id: 404,
  1704. menuType: 0,
  1705. title: "menus.pureSystemLog",
  1706. name: "SystemLog",
  1707. path: "/monitor/system-logs",
  1708. component: "monitor/logs/system/index",
  1709. rank: null,
  1710. redirect: "",
  1711. icon: "ri:file-search-line",
  1712. extraIcon: "",
  1713. enterTransition: "",
  1714. leaveTransition: "",
  1715. activePath: "",
  1716. auths: "",
  1717. frameSrc: "",
  1718. frameLoading: true,
  1719. keepAlive: false,
  1720. hiddenTag: false,
  1721. fixedTag: false,
  1722. showLink: true,
  1723. showParent: false
  1724. }
  1725. ]
  1726. },
  1727. requestHeaders: {
  1728. Accept: "application/json, text/plain, */*",
  1729. "Accept-Encoding": "gzip, deflate",
  1730. "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
  1731. Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
  1732. Connection: "keep-alive",
  1733. "Content-Length": 0,
  1734. Cookie:
  1735. "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
  1736. Host: "192.168.2.121:8848",
  1737. Origin: "http://192.168.2.121:8848",
  1738. Referer: "http://192.168.2.121:8848/",
  1739. "User-Agent":
  1740. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
  1741. "X-Requested-With": "XMLHttpRequest"
  1742. },
  1743. requestBody: {
  1744. title: "系统监控"
  1745. },
  1746. traceId: "1495502411171032",
  1747. requestTime: new Date()
  1748. };
  1749. } else if (body.id == 2) {
  1750. return {
  1751. id: 2,
  1752. level: 0,
  1753. module: "地图",
  1754. url: "/get-map-info?plateNumber=豫A59778U",
  1755. method: "get",
  1756. ip: faker.internet.ipv4(),
  1757. address: "中国广东省深圳市",
  1758. system: "Windows",
  1759. browser: "Firefox",
  1760. takesTime: 1200,
  1761. responseHeaders: {
  1762. traceId: "2280443117103208",
  1763. "Content-Type": "application/json",
  1764. Connection: "keep-alive",
  1765. "Keep-Alive": "timeout=5",
  1766. "Content-Length": 28693
  1767. },
  1768. responseBody: {
  1769. plateNumber: "豫A59778U",
  1770. driver: "子骞",
  1771. orientation: 289,
  1772. lng: 113.8564,
  1773. lat: 34.373
  1774. },
  1775. requestHeaders: {
  1776. Accept: "application/json, text/plain, */*",
  1777. "Accept-Encoding": "gzip, deflate",
  1778. "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
  1779. Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
  1780. Connection: "keep-alive",
  1781. "Content-Length": 0,
  1782. Cookie:
  1783. "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
  1784. Host: "192.168.2.121:8848",
  1785. Origin: "http://192.168.2.121:8848",
  1786. Referer: "http://192.168.2.121:8848/",
  1787. "User-Agent":
  1788. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
  1789. "X-Requested-With": "XMLHttpRequest"
  1790. },
  1791. requestBody: null,
  1792. traceId: "2280443117103208",
  1793. requestTime: new Date()
  1794. };
  1795. }
  1796. }
  1797. }
  1798. ]);