123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863 |
- import { defineFakeRoute } from "vite-plugin-fake-server/client";
- import { faker } from "@faker-js/faker/locale/zh_CN";
- export default defineFakeRoute([
- //消息类型
- {
- url: "/fetchMessageType",
- method: "get",
- response: () => {
- return {
- success: true,
- data: {
- records: [
- {
- id: 1,
- applicationId: 1,
- sceneCode: "MT1212121212",
- sceneName: "网关vip消息类型",
- sceneMessageType: "其他",
- sendTypeDescribe: "钉钉,微信",
- status: 1,
- remark: "",
- createTime: "2023-12-12"
- }
- ],
- total: 10,
- pageSize: 10,
- pageName: 1
- }
- };
- }
- },
- // 用户管理-获取所有角色列表
- {
- url: "/fetchDynamicData",
- method: "get",
- response: () => {
- return {
- success: true,
- data: {
- records: [
- {
- id: 1,
- name: "微信小程序网关",
- parameterDefine:
- '[{"name":"key","desc":"密钥","type":"radio","required":true,"encrypt":true,"values":"","titles":"","dataList":[{"label":"1"},{"label":"2"},{"label":"3"}]},{"name":"name","desc":"名字","type":"checkbox","required":true,"encrypt":true,"values":"","titles":"","dataList":[{"label":"1"},{"label":"2"},{"label":"3"},{"label":"4"}]},{"name":"备注","desc":"remark","type":"input","required":true,"encrypt":true,"values":"","titles":"","dataList":[{"label":"选项一"}]}]',
- status: 1,
- createTime: "",
- remark: "",
- createBy: ""
- },
- {
- id: 2,
- name: "微信公众号网关",
- parameterDefine: "",
- status: 1,
- createTime: "",
- remark: "",
- createBy: ""
- }
- ],
- total: 10,
- pageSize: 10,
- pageName: 1
- }
- };
- }
- },
- // 用户管理
- {
- url: "/user",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- avatar: "https://avatars.githubusercontent.com/u/44761321",
- username: "admin",
- gatewayName: "微信健康平台小程序推送网关",
- phone: "15888886789",
- email: faker.internet.email(),
- sex: 0,
- id: 1,
- status: 1,
- dept: {
- // 部门id
- id: 103,
- // 部门名称
- name: "研发部门"
- },
- remark: "管理员",
- createTime: 1605456000000
- },
- {
- avatar: "https://avatars.githubusercontent.com/u/52823142",
- username: "common",
- gatewayName: "微信公众号推送网关",
- phone: "18288882345",
- email: faker.internet.email(),
- sex: 1,
- id: 2,
- status: 1,
- dept: {
- id: 105,
- name: "测试部门"
- },
- remark: "普通用户",
- createTime: 1605456000000
- }
- ];
- list = list.filter(item => item.username.includes(body?.username));
- list = list.filter(item =>
- String(item.status).includes(String(body?.status))
- );
- if (body.phone) list = list.filter(item => item.phone === body.phone);
- if (body.deptId) list = list.filter(item => item.dept.id === body.deptId);
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 用户管理-获取所有角色列表
- {
- url: "/list-all-role",
- method: "get",
- response: () => {
- return {
- success: true,
- data: [
- { id: 1, name: "超级管理员" },
- { id: 2, name: "普通角色" }
- ]
- };
- }
- },
- // 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id)
- {
- url: "/list-role-ids",
- method: "post",
- response: ({ body }) => {
- if (body.userId) {
- if (body.userId == 1) {
- return {
- success: true,
- data: [1]
- };
- } else if (body.userId == 2) {
- return {
- success: true,
- data: [2]
- };
- }
- } else {
- return {
- success: false,
- data: []
- };
- }
- }
- },
- // 角色管理
- {
- url: "/role",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- createTime: 1605456000000, // 时间戳(毫秒ms)
- updateTime: 1684512000000,
- id: 1,
- gatewayName: "微信健康平台小程序推送网关",
- code: "admin",
- status: 1, // 状态 1 启用 0 停用
- remark: "超级管理员拥有最高权限"
- },
- {
- createTime: 1605456000000,
- updateTime: 1684512000000,
- id: 2,
- gatewayName: "微信公众号推送网关",
- code: "common",
- status: 1,
- remark: "普通角色拥有部分权限"
- }
- ];
- list = list.filter(item => item.gatewayName.includes(body?.name));
- list = list.filter(item =>
- String(item.status).includes(String(body?.status))
- );
- if (body.code) list = list.filter(item => item.code === body.code);
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 角色管理-权限-菜单权限
- {
- url: "/role-menu",
- method: "post",
- response: () => {
- return {
- success: true,
- data: [
- // 外部页面
- {
- parentId: 0,
- id: 100,
- menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
- title: "menus.pureExternalPage"
- },
- {
- parentId: 100,
- id: 101,
- menuType: 0,
- title: "menus.pureExternalDoc"
- },
- {
- parentId: 101,
- id: 102,
- menuType: 2,
- title: "menus.pureExternalLink"
- },
- {
- parentId: 101,
- id: 103,
- menuType: 2,
- title: "menus.pureUtilsLink"
- },
- {
- parentId: 100,
- id: 104,
- menuType: 1,
- title: "menus.pureEmbeddedDoc"
- },
- {
- parentId: 104,
- id: 105,
- menuType: 1,
- title: "menus.pureEpDoc"
- },
- {
- parentId: 104,
- id: 106,
- menuType: 1,
- title: "menus.pureTailwindcssDoc"
- },
- {
- parentId: 104,
- id: 107,
- menuType: 1,
- title: "menus.pureVueDoc"
- },
- {
- parentId: 104,
- id: 108,
- menuType: 1,
- title: "menus.pureViteDoc"
- },
- {
- parentId: 104,
- id: 109,
- menuType: 1,
- title: "menus.purePiniaDoc"
- },
- {
- parentId: 104,
- id: 110,
- menuType: 1,
- title: "menus.pureRouterDoc"
- },
- // 权限管理
- {
- parentId: 0,
- id: 200,
- menuType: 0,
- title: "menus.purePermission"
- },
- {
- parentId: 200,
- id: 201,
- menuType: 0,
- title: "menus.purePermissionPage"
- },
- {
- parentId: 200,
- id: 202,
- menuType: 0,
- title: "menus.purePermissionButton"
- },
- {
- parentId: 202,
- id: 203,
- menuType: 3,
- title: "添加"
- },
- {
- parentId: 202,
- id: 204,
- menuType: 3,
- title: "修改"
- },
- {
- parentId: 202,
- id: 205,
- menuType: 3,
- title: "删除"
- },
- // 系统管理
- {
- parentId: 0,
- id: 300,
- menuType: 0,
- title: "menus.pureSysManagement"
- },
- {
- parentId: 300,
- id: 301,
- menuType: 0,
- title: "menus.pureUser"
- },
- {
- parentId: 300,
- id: 302,
- menuType: 0,
- title: "menus.pureRole"
- },
- {
- parentId: 300,
- id: 303,
- menuType: 0,
- title: "menus.pureSystemMenu"
- },
- {
- parentId: 300,
- id: 304,
- menuType: 0,
- title: "menus.pureDept"
- },
- // 系统监控
- {
- parentId: 0,
- id: 400,
- menuType: 0,
- title: "menus.pureSysMonitor"
- },
- {
- parentId: 400,
- id: 401,
- menuType: 0,
- title: "menus.pureOnlineUser"
- },
- {
- parentId: 400,
- id: 402,
- menuType: 0,
- title: "menus.pureLoginLog"
- },
- {
- parentId: 400,
- id: 403,
- menuType: 0,
- title: "menus.pureOperationLog"
- },
- {
- parentId: 400,
- id: 404,
- menuType: 0,
- title: "menus.pureSystemLog"
- },
- // 标签页操作
- {
- parentId: 0,
- id: 500,
- menuType: 0,
- title: "menus.pureTabs"
- },
- {
- parentId: 500,
- id: 501,
- menuType: 0,
- title: "menus.pureTabs"
- },
- {
- parentId: 500,
- id: 502,
- menuType: 0,
- title: "query传参模式"
- },
- {
- parentId: 500,
- id: 503,
- menuType: 0,
- title: "params传参模式"
- }
- ]
- };
- }
- },
- // 角色管理-权限-菜单权限-根据角色 id 查对应菜单
- {
- url: "/role-menu-ids",
- method: "post",
- response: ({ body }) => {
- if (body.id == 1) {
- return {
- success: true,
- data: [
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
- 202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
- 404, 500, 501, 502, 503
- ]
- };
- } else if (body.id == 2) {
- return {
- success: true,
- data: [
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
- 501, 502, 503
- ]
- };
- }
- }
- },
- // 菜单管理
- {
- url: "/menu",
- method: "post",
- response: () => {
- return {
- success: true,
- data: [
- // 外部页面
- {
- parentId: 0,
- id: 100,
- menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
- title: "menus.pureExternalPage",
- name: "PureIframe",
- path: "/iframe",
- component: "",
- rank: 7,
- redirect: "",
- icon: "ri:links-fill",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 100,
- id: 101,
- menuType: 0,
- title: "menus.pureExternalDoc",
- name: "PureIframeExternal",
- path: "/iframe/external",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 101,
- id: 102,
- menuType: 2,
- title: "menus.pureExternalLink",
- name: "https://pure-admin.cn/",
- path: "/external",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 101,
- id: 103,
- menuType: 2,
- title: "menus.pureUtilsLink",
- name: "https://pure-admin-utils.netlify.app/",
- path: "/pureUtilsLink",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 100,
- id: 104,
- menuType: 1,
- title: "menus.pureEmbeddedDoc",
- name: "PureIframeEmbedded",
- path: "/iframe/embedded",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 105,
- menuType: 1,
- title: "menus.pureEpDoc",
- name: "FrameEp",
- path: "/iframe/ep",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://element-plus.org/zh-CN/",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 106,
- menuType: 1,
- title: "menus.pureTailwindcssDoc",
- name: "FrameTailwindcss",
- path: "/iframe/tailwindcss",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://tailwindcss.com/docs/installation",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 107,
- menuType: 1,
- title: "menus.pureVueDoc",
- name: "FrameVue",
- path: "/iframe/vue3",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://cn.vuejs.org/",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 108,
- menuType: 1,
- title: "menus.pureViteDoc",
- name: "FrameVite",
- path: "/iframe/vite",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://cn.vitejs.dev/",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 109,
- menuType: 1,
- title: "menus.purePiniaDoc",
- name: "FramePinia",
- path: "/iframe/pinia",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://pinia.vuejs.org/zh/index.html",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 104,
- id: 110,
- menuType: 1,
- title: "menus.pureRouterDoc",
- name: "FrameRouter",
- path: "/iframe/vue-router",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "https://router.vuejs.org/zh/",
- frameLoading: true,
- keepAlive: true,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- // 权限管理
- {
- parentId: 0,
- id: 200,
- menuType: 0,
- title: "menus.purePermission",
- name: "PurePermission",
- path: "/permission",
- component: "",
- rank: 9,
- redirect: "",
- icon: "ep:lollipop",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 200,
- id: 201,
- menuType: 0,
- title: "menus.purePermissionPage",
- name: "PermissionPage",
- path: "/permission/page/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 200,
- id: 202,
- menuType: 0,
- title: "menus.purePermissionButton",
- name: "PermissionButton",
- path: "/permission/button",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 202,
- id: 203,
- menuType: 0,
- title: "menus.purePermissionButtonRouter",
- name: "PermissionButtonRouter",
- path: "/permission/button/router",
- component: "permission/button/index",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 203,
- id: 210,
- menuType: 3,
- title: "添加",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:add",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 203,
- id: 211,
- menuType: 3,
- title: "修改",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:edit",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 203,
- id: 212,
- menuType: 3,
- title: "删除",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:delete",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 202,
- id: 204,
- menuType: 0,
- title: "menus.purePermissionButtonLogin",
- name: "PermissionButtonLogin",
- path: "/permission/button/login",
- component: "permission/button/perms",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 204,
- id: 220,
- menuType: 3,
- title: "添加",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:add",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 204,
- id: 221,
- menuType: 3,
- title: "修改",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:edit",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 204,
- id: 222,
- menuType: 3,
- title: "删除",
- name: "",
- path: "",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "permission:btn:delete",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- // 系统管理
- {
- parentId: 0,
- id: 300,
- menuType: 0,
- title: "menus.pureSysManagement",
- name: "PureSystem",
- path: "/system",
- component: "",
- rank: 10,
- redirect: "",
- icon: "ri:settings-3-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 300,
- id: 301,
- menuType: 0,
- title: "menus.pureUser",
- name: "SystemUser",
- path: "/system/user/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "ri:admin-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 300,
- id: 302,
- menuType: 0,
- title: "menus.pureRole",
- name: "SystemRole",
- path: "/system/role/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "ri:admin-fill",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 300,
- id: 303,
- menuType: 0,
- title: "menus.pureSystemMenu",
- name: "SystemMenu",
- path: "/system/menu/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "ep:menu",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 300,
- id: 304,
- menuType: 0,
- title: "menus.pureDept",
- name: "SystemDept",
- path: "/system/dept/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "ri:git-branch-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- // 系统监控
- {
- parentId: 0,
- id: 400,
- menuType: 0,
- title: "menus.pureSysMonitor",
- name: "PureMonitor",
- path: "/monitor",
- component: "",
- rank: 11,
- redirect: "",
- icon: "ep:monitor",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 401,
- menuType: 0,
- title: "menus.pureOnlineUser",
- name: "OnlineUser",
- path: "/monitor/online-user",
- component: "monitor/online/index",
- rank: null,
- redirect: "",
- icon: "ri:user-voice-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 402,
- menuType: 0,
- title: "menus.pureLoginLog",
- name: "LoginLog",
- path: "/monitor/login-logs",
- component: "monitor/logs/login/index",
- rank: null,
- redirect: "",
- icon: "ri:window-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 403,
- menuType: 0,
- title: "menus.pureOperationLog",
- name: "OperationLog",
- path: "/monitor/operation-logs",
- component: "monitor/logs/operation/index",
- rank: null,
- redirect: "",
- icon: "ri:history-fill",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 404,
- menuType: 0,
- title: "menus.pureSystemLog",
- name: "SystemLog",
- path: "/monitor/system-logs",
- component: "monitor/logs/system/index",
- rank: null,
- redirect: "",
- icon: "ri:file-search-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- // 标签页操作
- {
- parentId: 0,
- id: 500,
- menuType: 0,
- title: "menus.pureTabs",
- name: "PureTabs",
- path: "/tabs",
- component: "",
- rank: 12,
- redirect: "",
- icon: "ri:bookmark-2-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 500,
- id: 501,
- menuType: 0,
- title: "menus.pureTabs",
- name: "Tabs",
- path: "/tabs/index",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 500,
- id: 502,
- menuType: 0,
- title: "query传参模式",
- name: "TabQueryDetail",
- path: "/tabs/query-detail",
- component: "",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "/tabs/index",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: false,
- showParent: false
- },
- {
- parentId: 500,
- id: 503,
- menuType: 0,
- title: "params传参模式",
- name: "TabParamsDetail",
- path: "/tabs/params-detail/:id",
- component: "params-detail",
- rank: null,
- redirect: "",
- icon: "",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "/tabs/index",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: false,
- showParent: false
- }
- ]
- };
- }
- },
- // 部门管理
- {
- url: "/dept",
- method: "post",
- response: () => {
- return {
- success: true,
- data: [
- {
- name: "杭州总公司",
- parentId: 0,
- id: 100,
- sort: 0,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1, // 状态 1 启用 0 停用
- type: 1, // 1 公司 2 分公司 3 部门
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "郑州分公司",
- parentId: 100,
- id: 101,
- sort: 1,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 2,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "研发部门",
- parentId: 101,
- id: 103,
- sort: 1,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "市场部门",
- parentId: 102,
- id: 108,
- sort: 1,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "深圳分公司",
- parentId: 100,
- id: 102,
- sort: 2,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 2,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "市场部门",
- parentId: 101,
- id: 104,
- sort: 2,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "财务部门",
- parentId: 102,
- id: 109,
- sort: 2,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "测试部门",
- parentId: 101,
- id: 105,
- sort: 3,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 0,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "财务部门",
- parentId: 101,
- id: 106,
- sort: 4,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 1,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- },
- {
- name: "运维部门",
- parentId: 101,
- id: 107,
- sort: 5,
- phone: "15888888888",
- principal: faker.person.firstName(),
- email: faker.internet.email(),
- status: 0,
- type: 3,
- createTime: 1605456000000,
- remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
- }
- ]
- };
- }
- },
- // 在线用户
- {
- url: "/online-logs",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- id: 1,
- username: "admin",
- ip: faker.internet.ipv4(),
- address: "中国河南省信阳市",
- system: "macOS",
- browser: "Chrome",
- loginTime: new Date()
- },
- {
- id: 2,
- username: "common",
- ip: faker.internet.ipv4(),
- address: "中国广东省深圳市",
- system: "Windows",
- browser: "Firefox",
- loginTime: new Date()
- }
- ];
- list = list.filter(item => item.username.includes(body?.username));
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 登录日志
- {
- url: "/login-logs",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- id: 1,
- username: "admin",
- ip: faker.internet.ipv4(),
- address: "中国河南省信阳市",
- system: "macOS",
- browser: "Chrome",
- status: 1, // 登录状态 1 成功 0 失败
- behavior: "账号登录",
- loginTime: new Date()
- },
- {
- id: 2,
- username: "common",
- ip: faker.internet.ipv4(),
- address: "中国广东省深圳市",
- system: "Windows",
- browser: "Firefox",
- status: 0,
- behavior: "第三方登录",
- loginTime: new Date()
- }
- ];
- list = list.filter(item => item.username.includes(body?.username));
- list = list.filter(item =>
- String(item.status).includes(String(body?.status))
- );
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 操作日志
- {
- url: "/operation-logs",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- id: 1,
- username: "admin",
- ip: faker.internet.ipv4(),
- address: "中国河南省信阳市",
- system: "macOS",
- browser: "Chrome",
- status: 1, // 操作状态 1 成功 0 失败
- summary: "菜单管理-添加菜单", // 操作概要
- module: "系统管理", // 所属模块
- operatingTime: new Date() // 操作时间
- },
- {
- id: 2,
- username: "common",
- ip: faker.internet.ipv4(),
- address: "中国广东省深圳市",
- system: "Windows",
- browser: "Firefox",
- status: 0,
- summary: "列表分页查询",
- module: "在线用户",
- operatingTime: new Date()
- }
- ];
- list = list.filter(item => item.module.includes(body?.module));
- list = list.filter(item =>
- String(item.status).includes(String(body?.status))
- );
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 系统日志
- {
- url: "/system-logs",
- method: "post",
- response: ({ body }) => {
- let list = [
- {
- id: 1, // 日志ID
- /**
- * 日志级别
- * 0 debug调试(最低级别的日志,用于调试和开发阶段)
- * 1 info信息(默认级别,用于记录一般的信息)
- * 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行)
- * 3 error错误(表示发生了错误,但不会导致系统崩溃)
- * 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行)
- */
- level: 1,
- module: "菜单管理", // 所属模块
- url: "/menu", // 请求接口
- method: "post", // 请求方法
- ip: faker.internet.ipv4(),
- address: "中国河南省信阳市",
- system: "macOS",
- browser: "Chrome",
- /**
- * 请求耗时(单位:ms 毫秒)
- * 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常
- * 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断
- */
- takesTime: 10,
- requestTime: new Date() // 请求时间
- },
- {
- id: 2,
- level: 0,
- module: "地图",
- url: "/get-map-info",
- method: "get",
- ip: faker.internet.ipv4(),
- address: "中国广东省深圳市",
- system: "Windows",
- browser: "Firefox",
- takesTime: 1200,
- requestTime: new Date()
- }
- ];
- list = list.filter(item => item.module.includes(body?.module));
- return {
- success: true,
- data: {
- list,
- total: list.length, // 总条目数
- pageSize: 10, // 每页显示条目个数
- currentPage: 1 // 当前页数
- }
- };
- }
- },
- // 系统日志-根据 id 查日志详情
- {
- url: "/system-logs-detail",
- method: "post",
- response: ({ body }) => {
- if (body.id == 1) {
- return {
- id: 1,
- level: 1,
- module: "菜单管理",
- url: "/menu",
- method: "post",
- ip: faker.internet.ipv4(),
- address: "中国河南省信阳市",
- system: "macOS",
- browser: "Chrome",
- takesTime: 10,
- responseHeaders: {
- traceId: "1495502411171032",
- "Content-Type": "application/json",
- Connection: "keep-alive",
- "Keep-Alive": "timeout=5",
- "Content-Length": 17019
- },
- responseBody: {
- success: true,
- data: [
- {
- parentId: 0,
- id: 400,
- menuType: 0,
- title: "menus.pureSysMonitor",
- name: "PureMonitor",
- path: "/monitor",
- component: "",
- rank: 11,
- redirect: "",
- icon: "ep:monitor",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 401,
- menuType: 0,
- title: "menus.pureOnlineUser",
- name: "OnlineUser",
- path: "/monitor/online-user",
- component: "monitor/online/index",
- rank: null,
- redirect: "",
- icon: "ri:user-voice-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 402,
- menuType: 0,
- title: "menus.pureLoginLog",
- name: "LoginLog",
- path: "/monitor/login-logs",
- component: "monitor/logs/login/index",
- rank: null,
- redirect: "",
- icon: "ri:window-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 403,
- menuType: 0,
- title: "menus.pureOperationLog",
- name: "OperationLog",
- path: "/monitor/operation-logs",
- component: "monitor/logs/operation/index",
- rank: null,
- redirect: "",
- icon: "ri:history-fill",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- },
- {
- parentId: 400,
- id: 404,
- menuType: 0,
- title: "menus.pureSystemLog",
- name: "SystemLog",
- path: "/monitor/system-logs",
- component: "monitor/logs/system/index",
- rank: null,
- redirect: "",
- icon: "ri:file-search-line",
- extraIcon: "",
- enterTransition: "",
- leaveTransition: "",
- activePath: "",
- auths: "",
- frameSrc: "",
- frameLoading: true,
- keepAlive: false,
- hiddenTag: false,
- fixedTag: false,
- showLink: true,
- showParent: false
- }
- ]
- },
- requestHeaders: {
- Accept: "application/json, text/plain, */*",
- "Accept-Encoding": "gzip, deflate",
- "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
- Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
- Connection: "keep-alive",
- "Content-Length": 0,
- Cookie:
- "_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",
- Host: "192.168.2.121:8848",
- Origin: "http://192.168.2.121:8848",
- Referer: "http://192.168.2.121:8848/",
- "User-Agent":
- "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",
- "X-Requested-With": "XMLHttpRequest"
- },
- requestBody: {
- title: "系统监控"
- },
- traceId: "1495502411171032",
- requestTime: new Date()
- };
- } else if (body.id == 2) {
- return {
- id: 2,
- level: 0,
- module: "地图",
- url: "/get-map-info?plateNumber=豫A59778U",
- method: "get",
- ip: faker.internet.ipv4(),
- address: "中国广东省深圳市",
- system: "Windows",
- browser: "Firefox",
- takesTime: 1200,
- responseHeaders: {
- traceId: "2280443117103208",
- "Content-Type": "application/json",
- Connection: "keep-alive",
- "Keep-Alive": "timeout=5",
- "Content-Length": 28693
- },
- responseBody: {
- plateNumber: "豫A59778U",
- driver: "子骞",
- orientation: 289,
- lng: 113.8564,
- lat: 34.373
- },
- requestHeaders: {
- Accept: "application/json, text/plain, */*",
- "Accept-Encoding": "gzip, deflate",
- "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
- Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
- Connection: "keep-alive",
- "Content-Length": 0,
- Cookie:
- "_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",
- Host: "192.168.2.121:8848",
- Origin: "http://192.168.2.121:8848",
- Referer: "http://192.168.2.121:8848/",
- "User-Agent":
- "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",
- "X-Requested-With": "XMLHttpRequest"
- },
- requestBody: null,
- traceId: "2280443117103208",
- requestTime: new Date()
- };
- }
- }
- }
- ]);
|