diff --git a/mock/dept.mock.ts b/mock/dept.mock.ts index 47dd2bc2..46e628d8 100644 --- a/mock/dept.mock.ts +++ b/mock/dept.mock.ts @@ -30,4 +30,46 @@ export default defineMock([ msg: "一切ok", }, }, + + { + url: "/api/v1/dept", + method: ["GET"], + body: { + code: "00000", + data: [ + { + id: 1, + parentId: 0, + name: "有来技术", + sort: 1, + status: 1, + children: [ + { + id: 2, + parentId: 1, + name: "研发部门", + sort: 1, + status: 1, + children: [], + createTime: null, + updateTime: "2022-04-19 12:46", + }, + { + id: 3, + parentId: 1, + name: "测试部门", + sort: 1, + status: 1, + children: [], + createTime: null, + updateTime: "2022-04-19 12:46", + }, + ], + createTime: null, + updateTime: null, + }, + ], + msg: "一切ok", + }, + }, ]); diff --git a/mock/dict.mock.ts b/mock/dict.mock.ts index 8a6cfed1..9f4a17de 100644 --- a/mock/dict.mock.ts +++ b/mock/dict.mock.ts @@ -38,4 +38,62 @@ export default defineMock([ }; }, }, + + { + url: "/api/v1/dict/types/page", + method: ["GET"], + body: { + code: "00000", + data: { + list: [ + { + id: 1, + name: "性别", + code: "gender", + status: 1, + }, + { + id: 2, + name: "状态", + code: "status", + status: 1, + }, + ], + total: 2, + }, + msg: "一切ok", + }, + }, + + { + url: "/api/v1/dict/page", + method: ["GET"], + body: { + code: "00000", + data: { + list: [ + { + id: 1, + name: "男", + value: "1", + status: 1, + }, + { + id: 2, + name: "女", + value: "2", + status: 1, + }, + { + id: 3, + name: "未知", + value: "0", + status: 1, + }, + ], + total: 3, + }, + msg: "一切ok", + }, + }, ]); diff --git a/mock/menu.mock.ts b/mock/menu.mock.ts index 215c9b15..6924c120 100644 --- a/mock/menu.mock.ts +++ b/mock/menu.mock.ts @@ -16,12 +16,12 @@ export default defineMock([ path: "/system", component: "Layout", redirect: "/system/user", + name: "/system", meta: { title: "系统管理", icon: "system", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, children: [ { @@ -75,7 +75,7 @@ export default defineMock([ { path: "dict", component: "system/dict/index", - name: "DictType", + name: "Dict", meta: { title: "字典管理", icon: "dict", @@ -86,52 +86,86 @@ export default defineMock([ }, ], }, - { path: "/api", component: "Layout", + name: "/api", meta: { - title: "接口", + title: "接口文档", icon: "api", hidden: false, roles: ["ADMIN"], - keepAlive: true, + alwaysShow: true, }, children: [ { - path: "apidoc", - component: "demo/api-doc", - name: "Apidoc", + path: "apifox", + component: "demo/api/apifox", + name: "Apifox", meta: { - title: "接口文档", + title: "Apifox", icon: "api", hidden: false, roles: ["ADMIN"], - keepAlive: false, + keepAlive: true, + }, + }, + { + path: "swagger", + component: "demo/api/swagger", + name: "Swagger", + meta: { + title: "Swagger", + icon: "api", + hidden: true, + roles: ["ADMIN"], + keepAlive: true, + }, + }, + { + path: "knife4j", + component: "demo/api/knife4j", + name: "Knife4j", + meta: { + title: "Knife4j", + icon: "api", + hidden: true, + roles: ["ADMIN"], + keepAlive: true, }, }, ], }, { - path: "/external-link", + path: "/doc", component: "Layout", - redirect: "noredirect", + name: "/doc", meta: { - title: "外部链接", - icon: "link", + title: "平台文档", + icon: "document", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, children: [ { - path: "https://juejin.cn/post/7228990409909108793", + path: "internal-doc", + component: "demo/internal-doc", + name: "InternalDoc", meta: { - title: "document", + title: "平台文档(内嵌)", icon: "document", hidden: false, roles: ["ADMIN"], - keepAlive: true, + }, + }, + { + path: "https://juejin.cn/post/7228990409909108793", + name: "Https://juejin.cn/post/7228990409909108793", + meta: { + title: "平台文档(外链)", + icon: "link", + hidden: false, + roles: ["ADMIN"], }, }, ], @@ -140,18 +174,19 @@ export default defineMock([ path: "/multi-level", component: "Layout", redirect: "/multi-level/multi-level1", + name: "/multiLevel", meta: { title: "多级菜单", - icon: "multi_level", + icon: "cascader", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, children: [ { path: "multi-level1", component: "demo/multi-level/level1", redirect: "/multi-level/multi-level2", + name: "MultiLevel1", meta: { title: "菜单一级", icon: "", @@ -164,6 +199,7 @@ export default defineMock([ path: "multi-level2", component: "demo/multi-level/children/level2", redirect: "/multi-level/multi-level2/multi-level3-1", + name: "MultiLevel2", meta: { title: "菜单二级", icon: "", @@ -205,18 +241,18 @@ export default defineMock([ { path: "/component", component: "Layout", + name: "/component", meta: { title: "组件封装", icon: "menu", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, children: [ { path: "wang-editor", component: "demo/wang-editor", - name: "wang-editor", + name: "WangEditor", meta: { title: "富文本编辑器", icon: "", @@ -228,7 +264,7 @@ export default defineMock([ { path: "upload", component: "demo/upload", - name: "upload", + name: "Upload", meta: { title: "图片上传", icon: "", @@ -240,7 +276,7 @@ export default defineMock([ { path: "icon-selector", component: "demo/icon-selector", - name: "icon-selector", + name: "IconSelector", meta: { title: "图标选择器", icon: "", @@ -261,22 +297,10 @@ export default defineMock([ keepAlive: true, }, }, - { - path: "taginput", - component: "demo/taginput", - name: "taginput", - meta: { - title: "标签输入框", - icon: "", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - }, { path: "signature", component: "demo/signature", - name: "signature", + name: "Signature", meta: { title: "签名", icon: "", @@ -299,91 +323,33 @@ export default defineMock([ }, ], }, - { - path: "/table", - component: "Layout", - meta: { - title: "Table", - icon: "table", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - children: [ - { - path: "dynamic-table", - component: "demo/table/dynamic-table/index", - name: "DynamicTable", - meta: { - title: "动态Table", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - }, - { - path: "drag-table", - component: "demo/table/drag-table", - name: "DragTable", - meta: { - title: "拖拽Table", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - }, - { - path: "complex-table", - component: "demo/table/complex-table", - name: "ComplexTable", - meta: { - title: "综合Table", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - }, - ], - }, { path: "/function", component: "Layout", + name: "/function", meta: { title: "功能演示", icon: "menu", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, children: [ - { - path: "permission", - component: "demo/permission/page", - name: "Permission", - meta: { - title: "Permission", - icon: "", - hidden: false, - roles: ["ADMIN"], - keepAlive: true, - }, - }, { path: "icon-demo", component: "demo/icons", - name: "Icons", + name: "IconDemo", meta: { - title: "图标", - icon: "", + title: "Icons", + icon: "el-icon-edit", hidden: false, roles: ["ADMIN"], keepAlive: true, }, }, { - path: "websocket", + path: "/function/websocket", component: "demo/websocket", - name: "Websocket", + name: "/function/websocket", meta: { title: "Websocket", icon: "", @@ -395,12 +361,12 @@ export default defineMock([ { path: "other", component: "demo/other", + name: "Other", meta: { title: "敬请期待...", icon: "", hidden: false, roles: ["ADMIN"], - keepAlive: true, }, }, ], @@ -409,4 +375,700 @@ export default defineMock([ msg: "一切ok", }, }, + + { + url: "/api/v1/menus", // 路径会拼接为: /dev-api/api/v1/menus/routes + method: ["GET"], + body: { + code: "00000", + data: [ + { + id: 1, + parentId: 0, + name: "系统管理", + type: "CATALOG", + path: "/system", + component: "Layout", + sort: 1, + visible: 1, + icon: "system", + redirect: "/system/user", + perm: null, + children: [ + { + id: 2, + parentId: 1, + name: "用户管理", + type: "MENU", + path: "user", + component: "system/user/index", + sort: 1, + visible: 1, + icon: "user", + redirect: null, + perm: null, + children: [ + { + id: 31, + parentId: 2, + name: "用户新增", + type: "BUTTON", + path: "", + component: null, + sort: 1, + visible: 1, + icon: "", + redirect: "", + perm: "sys:user:add", + children: [], + }, + { + id: 32, + parentId: 2, + name: "用户编辑", + type: "BUTTON", + path: "", + component: null, + sort: 2, + visible: 1, + icon: "", + redirect: "", + perm: "sys:user:edit", + children: [], + }, + { + id: 33, + parentId: 2, + name: "用户删除", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: "", + perm: "sys:user:delete", + children: [], + }, + { + id: 88, + parentId: 2, + name: "重置密码", + type: "BUTTON", + path: "", + component: null, + sort: 4, + visible: 1, + icon: "", + redirect: null, + perm: "sys:user:reset_pwd", + children: [], + }, + ], + }, + { + id: 3, + parentId: 1, + name: "角色管理", + type: "MENU", + path: "role", + component: "system/role/index", + sort: 2, + visible: 1, + icon: "role", + redirect: null, + perm: null, + children: [ + { + id: 70, + parentId: 3, + name: "角色新增", + type: "BUTTON", + path: "", + component: null, + sort: 1, + visible: 1, + icon: "", + redirect: null, + perm: "sys:role:add", + children: [], + }, + { + id: 71, + parentId: 3, + name: "角色编辑", + type: "BUTTON", + path: "", + component: null, + sort: 2, + visible: 1, + icon: "", + redirect: null, + perm: "sys:role:edit", + children: [], + }, + { + id: 72, + parentId: 3, + name: "角色删除", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: null, + perm: "sys:role:delete", + children: [], + }, + ], + }, + { + id: 4, + parentId: 1, + name: "菜单管理", + type: "MENU", + path: "menu", + component: "system/menu/index", + sort: 3, + visible: 1, + icon: "menu", + redirect: null, + perm: null, + children: [ + { + id: 73, + parentId: 4, + name: "菜单新增", + type: "BUTTON", + path: "", + component: null, + sort: 1, + visible: 1, + icon: "", + redirect: null, + perm: "sys:menu:add", + children: [], + }, + { + id: 74, + parentId: 4, + name: "菜单编辑", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: null, + perm: "sys:menu:edit", + children: [], + }, + { + id: 75, + parentId: 4, + name: "菜单删除", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: null, + perm: "sys:menu:delete", + children: [], + }, + ], + }, + { + id: 5, + parentId: 1, + name: "部门管理", + type: "MENU", + path: "dept", + component: "system/dept/index", + sort: 4, + visible: 1, + icon: "tree", + redirect: null, + perm: null, + children: [ + { + id: 76, + parentId: 5, + name: "部门新增", + type: "BUTTON", + path: "", + component: null, + sort: 1, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dept:add", + children: [], + }, + { + id: 77, + parentId: 5, + name: "部门编辑", + type: "BUTTON", + path: "", + component: null, + sort: 2, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dept:edit", + children: [], + }, + { + id: 78, + parentId: 5, + name: "部门删除", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dept:delete", + children: [], + }, + ], + }, + { + id: 6, + parentId: 1, + name: "字典管理", + type: "MENU", + path: "dict", + component: "system/dict/index", + sort: 5, + visible: 1, + icon: "dict", + redirect: null, + perm: null, + children: [ + { + id: 79, + parentId: 6, + name: "字典类型新增", + type: "BUTTON", + path: "", + component: null, + sort: 1, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict_type:add", + children: [], + }, + { + id: 81, + parentId: 6, + name: "字典类型编辑", + type: "BUTTON", + path: "", + component: null, + sort: 2, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict_type:edit", + children: [], + }, + { + id: 84, + parentId: 6, + name: "字典类型删除", + type: "BUTTON", + path: "", + component: null, + sort: 3, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict_type:delete", + children: [], + }, + { + id: 85, + parentId: 6, + name: "字典数据新增", + type: "BUTTON", + path: "", + component: null, + sort: 4, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict:add", + children: [], + }, + { + id: 86, + parentId: 6, + name: "字典数据编辑", + type: "BUTTON", + path: "", + component: null, + sort: 5, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict:edit", + children: [], + }, + { + id: 87, + parentId: 6, + name: "字典数据删除", + type: "BUTTON", + path: "", + component: null, + sort: 6, + visible: 1, + icon: "", + redirect: null, + perm: "sys:dict:delete", + children: [], + }, + ], + }, + ], + }, + { + id: 40, + parentId: 0, + name: "接口文档", + type: "CATALOG", + path: "/api", + component: "Layout", + sort: 7, + visible: 1, + icon: "api", + redirect: "", + perm: null, + children: [ + { + id: 41, + parentId: 40, + name: "Apifox", + type: "MENU", + path: "apifox", + component: "demo/api/apifox", + sort: 1, + visible: 1, + icon: "api", + redirect: "", + perm: null, + children: [], + }, + { + id: 103, + parentId: 40, + name: "Swagger", + type: "MENU", + path: "swagger", + component: "demo/api/swagger", + sort: 2, + visible: 0, + icon: "api", + redirect: "", + perm: null, + children: [], + }, + { + id: 104, + parentId: 40, + name: "Knife4j", + type: "MENU", + path: "knife4j", + component: "demo/api/knife4j", + sort: 3, + visible: 0, + icon: "api", + redirect: "", + perm: null, + children: [], + }, + ], + }, + { + id: 26, + parentId: 0, + name: "平台文档", + type: "CATALOG", + path: "/doc", + component: "Layout", + sort: 8, + visible: 1, + icon: "document", + redirect: null, + perm: null, + children: [ + { + id: 102, + parentId: 26, + name: "平台文档(内嵌)", + type: "EXTLINK", + path: "internal-doc", + component: "demo/internal-doc", + sort: 1, + visible: 1, + icon: "document", + redirect: "", + perm: null, + children: [], + }, + { + id: 30, + parentId: 26, + name: "平台文档(外链)", + type: "EXTLINK", + path: "https://juejin.cn/post/7228990409909108793", + component: "", + sort: 2, + visible: 1, + icon: "link", + redirect: "", + perm: null, + children: [], + }, + ], + }, + { + id: 20, + parentId: 0, + name: "多级菜单", + type: "CATALOG", + path: "/multi-level", + component: "Layout", + sort: 9, + visible: 1, + icon: "cascader", + redirect: "/multi-level/multi-level1", + perm: null, + children: [ + { + id: 21, + parentId: 20, + name: "菜单一级", + type: "MENU", + path: "multi-level1", + component: "demo/multi-level/level1", + sort: 1, + visible: 1, + icon: "", + redirect: "/multi-level/multi-level2", + perm: null, + children: [ + { + id: 22, + parentId: 21, + name: "菜单二级", + type: "MENU", + path: "multi-level2", + component: "demo/multi-level/children/level2", + sort: 1, + visible: 1, + icon: "", + redirect: "/multi-level/multi-level2/multi-level3-1", + perm: null, + children: [ + { + id: 23, + parentId: 22, + name: "菜单三级-1", + type: "MENU", + path: "multi-level3-1", + component: "demo/multi-level/children/children/level3-1", + sort: 1, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 24, + parentId: 22, + name: "菜单三级-2", + type: "MENU", + path: "multi-level3-2", + component: "demo/multi-level/children/children/level3-2", + sort: 2, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + ], + }, + ], + }, + ], + }, + { + id: 36, + parentId: 0, + name: "组件封装", + type: "CATALOG", + path: "/component", + component: "Layout", + sort: 10, + visible: 1, + icon: "menu", + redirect: "", + perm: null, + children: [ + { + id: 37, + parentId: 36, + name: "富文本编辑器", + type: "MENU", + path: "wang-editor", + component: "demo/wang-editor", + sort: 1, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 38, + parentId: 36, + name: "图片上传", + type: "MENU", + path: "upload", + component: "demo/upload", + sort: 2, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 39, + parentId: 36, + name: "图标选择器", + type: "MENU", + path: "icon-selector", + component: "demo/icon-selector", + sort: 3, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 95, + parentId: 36, + name: "字典组件", + type: "MENU", + path: "dict-demo", + component: "demo/dict", + sort: 4, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 93, + parentId: 36, + name: "签名", + type: "MENU", + path: "signature", + component: "demo/signature", + sort: 6, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 94, + parentId: 36, + name: "表格", + type: "MENU", + path: "table", + component: "demo/table", + sort: 7, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + ], + }, + { + id: 89, + parentId: 0, + name: "功能演示", + type: "CATALOG", + path: "/function", + component: "Layout", + sort: 11, + visible: 1, + icon: "menu", + redirect: "", + perm: null, + children: [ + { + id: 97, + parentId: 89, + name: "Icons", + type: "MENU", + path: "icon-demo", + component: "demo/icons", + sort: 2, + visible: 1, + icon: "el-icon-edit", + redirect: "", + perm: null, + children: [], + }, + { + id: 90, + parentId: 89, + name: "Websocket", + type: "MENU", + path: "/function/websocket", + component: "demo/websocket", + sort: 3, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + { + id: 91, + parentId: 89, + name: "敬请期待...", + type: "CATALOG", + path: "other", + component: "demo/other", + sort: 4, + visible: 1, + icon: "", + redirect: "", + perm: null, + children: [], + }, + ], + }, + ], + msg: "一切ok", + }, + }, ]); diff --git a/mock/role.mock.ts b/mock/role.mock.ts index 060f914e..b6124613 100644 --- a/mock/role.mock.ts +++ b/mock/role.mock.ts @@ -60,4 +60,108 @@ export default defineMock([ msg: "一切ok", }, }, + + { + url: "/api/v1/roles/page", + method: ["GET"], + body: { + code: "00000", + data: { + list: [ + { + id: 2, + name: "系统管理员", + code: "ADMIN", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 3, + name: "访问游客", + code: "GUEST", + status: 1, + sort: 3, + createTime: "2021-05-26 15:49:05", + updateTime: "2019-05-05 16:00:00", + }, + { + id: 4, + name: "系统管理员1", + code: "ADMIN1", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 5, + name: "系统管理员2", + code: "ADMIN2", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 6, + name: "系统管理员3", + code: "ADMIN3", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 7, + name: "系统管理员4", + code: "ADMIN4", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 8, + name: "系统管理员5", + code: "ADMIN5", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 9, + name: "系统管理员6", + code: "ADMIN6", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: "2023-12-04 11:43:15", + }, + { + id: 10, + name: "系统管理员7", + code: "ADMIN7", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + { + id: 11, + name: "系统管理员8", + code: "ADMIN8", + status: 1, + sort: 2, + createTime: "2021-03-25 12:39:54", + updateTime: null, + }, + ], + total: 10, + }, + msg: "一切ok", + }, + }, ]); diff --git a/mock/user.mock.ts b/mock/user.mock.ts index b92c134c..bc30fb7a 100644 --- a/mock/user.mock.ts +++ b/mock/user.mock.ts @@ -129,25 +129,3 @@ export default defineMock([ }, }, ]); - -import { defineMock } from "vite-plugin-mock-dev-server"; - -export default defineMock([ - { - url: "/api/hello_world", - method: ["GET"], - }, - { - url: "/api/v1/auth/captcha", - method: ["GET"], - body: { - code: "00000", - data: { - captchaKey: "534b8ef2b0a24121bec76391ddd159f9", - captchaBase64: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAkCAIAAADNSmkJAAAFKUlEQVR4Xu2ZXUwcVRiGV70wMWo08V5NvPXCrDbFaGpMaZW2hqQxaoiJTRsaMBCNSYtpa2JTKiFSelFa+Q/QZcMWqEhBlh+htbEpZhMrBQrlJ0hBywLLyrJ0WZbje3bqOvPNLHPWrDvdOE9ONmfe78zkzMs335wzWJhJQrBQweS/wTQ6QWgYHdoIOcecOe05O+t2WkutO+p2ZF3Ksg/YV9ZW6FATYajR3nveg60H9327r3O8c35lHgp+r05dPdJzBL73TPSQ8SaCKIxGLsPlop+K0JHrEkPuoT31e5qGmmjARACF0agYyGVNlyVm/pzZXrN9fHGcBkz0UBid+31u93i3XFFT80vN8cvHqWqih8Lo1NpUqS5vwh3vnd223VQ10UNh9NbyrcFQUK6oCawHUipSqGqiB83oBf+CXFGDMp1mS6OqiR4Ko7FexkpOrqhpHGw82nOUqiZ6KIzGrkRuorW0dJMmOy+hOCfYGzb2RBFv6HRO0gEJw/U7y+pgL1bwmTxexN6sZ31TdEwEhdG+gA+7EqyXpUO1uZH20cWL8hMTRt1N9tBXzCJrOIRoCPJpSO2RAp4HmtCdIfZ+2JWgEBN9LbR28seTGU0Zue1tMLp+YIAMSADzfvbkKX4/eb28j4YODiGin3heqmIlLja5hAUCu+nmGY3JWKvpMAlqNGgebsauBOvlqSX+JEx7p7EbTLen53XlzfmWUioqXikrc68Y8N2juJ/fyVsNChGHEE//rBANYWaZz+TRQqpLaBgNsPfDrgSpbS21YtV87IdjrlkX9JZbt5DOma2t9ITo5F+5glN22WwL/n+yDv00mw06orKxOqQ5+J04hhViwzAXETIcJDVm8uxZqktoGx2Nj9t43Wgaul/ERQiGQvtbWnDWgZYW9CXlQFjZ/7ciyHNn+Z2MexTimIeLz59TiIln0M1e+IbPpOAaDUnEYPTi6iqKxpbycs/qKo1tCslfKcffPn9enuMiPPY1vxO/ckeFQ4h46cdGqUWoidE/y54q5tPY5WDrGzQqIXot4BgchEE57e00IMCw2/1qZSVO/7SjA78o9INzcxsbrL+fnTnDDh9mmZn8F30oG1Hm+nABv5mQMopDS/h1HxtqTzWbABMe9sxpPoe9zezeOo1GELqWhPS8t46M0IAYHbdvR1aHbaOjbjfLz2eFhez6dba4yAfgF30o0BFVE8+Mjh/wFxPI+I5mAEHU6Ls+38vhTFwOBGhMDF8gkFpbC5ffsdv/uBs6dIj19dExEtARVXv9YNbop8NFY3aZ6gRRo+tu3IBHnzmdNCBMXldXJKPfL74WzWUJRE+coDUknqsOdZXQbAJYwluVTbOZI3Qt8GFzMwxyjo3RgBiN4fr+elXVpZGRLWXl6PdOTtJBSlBDUK/lnIrjOlrtqWYTQDJaF6FrTXu9sOa1ysrVoM5HVE1GFxZQcyJ/p+xzv6K/rbr6N6+XDpUBl0tKFIrbz78qWB6YnWFMCBld4XLBms+7df75ook/GNzb0GCV7U1Qfz9p64TyQWNjYD3qe9rj4SMJtQP3MyjSDPzWIRHPjH7X4YAvfXoPuyZf9Pbi3PcuXIh4mp3NllYC6XY79C+jl2o8PBipxjnBttn4MgMNnWgfcRJGPI2OL8hTj3LloIlmRicvBhiNykvecpqoa3RSY4DRcLAwyicuOepVR1JjgNFYHWONHL04czTX0UmNAUYD7Pr+xc4wqTHGaBb2OtZvHUmNYUazcA2J6etdUmOk0f8rTKMTxF91RG0D1SwYGwAAAABJRU5ErkJggg==", - }, - msg: "一切ok", - }, - }, -]); diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index aa6267b4..f58f7d34 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -79,7 +79,6 @@ const tagsViewStore = useTagsViewStore(); const appStore = useAppStore(); const { visitedViews } = storeToRefs(tagsViewStore); -console.log("visitedViews", visitedViews); const settingsStore = useSettingsStore(); const layout = computed(() => settingsStore.layout); @@ -142,14 +141,11 @@ function filterAffixTags(routes: RouteRecordRaw[], basePath = "/") { let tags: TagView[] = []; routes.forEach(processRoute); - console.log("filterAffixTags", tags); - return tags; } function initTags() { const tags: TagView[] = filterAffixTags(permissionStore.routes); - console.log("initTags", tags); affixTags.value = tags; for (const tag of tags) { // Must have tag name @@ -160,7 +156,6 @@ function initTags() { } function addTags() { - console.log("addTags", visitedViews); if (route.meta.title) { tagsViewStore.addView({ name: route.name as string, @@ -174,7 +169,6 @@ function addTags() { } function moveToCurrentTag() { - console.log("moveToCurrentTag", visitedViews); // 使用 nextTick() 的目的是确保在更新 tagsView 组件之前,scrollPaneRef 对象已经滚动到了正确的位置。 nextTick(() => { for (const tag of visitedViews.value) { diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index b18646cf..6327ca99 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -4,13 +4,10 @@ export const useTagsViewStore = defineStore("tagsView", () => { const visitedViews = ref([]); const cachedViews = ref([]); - console.log("first visitedViews", visitedViews, "cachedViews", cachedViews); - /** * 添加已访问视图到已访问视图列表中 */ function addVisitedView(view: TagView) { - console.log("addVisitedView", visitedViews, view); // 如果已经存在于已访问的视图列表中,则不再添加 if (visitedViews.value.some((v) => v.fullPath === view.fullPath)) { return; @@ -28,7 +25,6 @@ export const useTagsViewStore = defineStore("tagsView", () => { * 添加缓存视图到缓存视图列表中 */ function addCachedView(view: TagView) { - console.log("addCachedView", visitedViews, view); const viewName = view.name; // 如果缓存视图名称已经存在于缓存视图列表中,则不再添加 if (cachedViews.value.includes(viewName)) { @@ -90,7 +86,6 @@ export const useTagsViewStore = defineStore("tagsView", () => { } function updateVisitedView(view: TagView) { - console.log("updateVisitedView", visitedViews, view); for (let v of visitedViews.value) { if (v.path === view.path) { v = Object.assign(v, view); @@ -100,7 +95,6 @@ export const useTagsViewStore = defineStore("tagsView", () => { } function addView(view: TagView) { - console.log("addView", visitedViews, view); addVisitedView(view); addCachedView(view); } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 82790d11..17742b7a 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -182,7 +182,6 @@ function openMenuDialog(row: RolePageVO) { getRoleMenuIds(roleId) .then(({ data }) => { const checkedMenuIds = data; - console.log("勾选权限", checkedMenuIds); checkedMenuIds.forEach((menuId) => menuRef.value.setChecked(menuId, true, false) ); diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 7b340e55..80ca5c4e 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -291,7 +291,6 @@ function downloadTemplate() { /** Excel文件 Change */ function handleFileChange(file: any) { importData.file = file.raw; - console.log(importData.file); } /** Excel文件 Exceed */ diff --git a/vite.config.ts b/vite.config.ts index 6710249f..15fa8bed 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -66,6 +66,8 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { UnoCSS({ hmrTopLevelAwait: false, }), + // MOCK 服务 + mockDevServerPlugin(), // 自动导入参考: https://github.com/sxzz/element-plus-best-practices/blob/main/vite.config.ts AutoImport({ // 自动导入 Vue 相关函数,如:ref, reactive, toRef 等 @@ -106,8 +108,6 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { // 指定symbolId格式 symbolId: "icon-[dir]-[name]", }), - // 开启 mock - mockDevServerPlugin(), ], // 预加载项目必需的组件 optimizeDeps: {