diff --git a/mock/log.mock.ts b/mock/log.mock.ts new file mode 100644 index 00000000..08e63f2e --- /dev/null +++ b/mock/log.mock.ts @@ -0,0 +1,225 @@ +import { defineMock } from "./base"; + +export default defineMock([ + { + url: "logs/page", + method: ["GET"], + body: { + code: "00000", + data: { + list: [ + { + id: 36192, + module: "菜单", + content: "菜单列表", + requestUri: "/api/v1/menus", + method: null, + ip: "183.156.148.241", + region: "浙江省 杭州市", + browser: "Chrome 109.0.0.0", + os: "OSX", + executionTime: 5, + createBy: null, + createTime: "2024-07-07 20:38:47", + operator: "系统管理员", + }, + { + id: 36190, + module: "字典", + content: "字典分页列表", + requestUri: "/api/v1/dict/page", + method: null, + ip: "183.156.148.241", + region: "浙江省 杭州市", + browser: "Chrome 109.0.0.0", + os: "OSX", + executionTime: 9, + createBy: null, + createTime: "2024-07-07 20:38:45", + operator: "系统管理员", + }, + { + id: 36193, + module: "部门", + content: "部门列表", + requestUri: "/api/v1/dept", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 27, + createBy: null, + createTime: "2024-07-07 20:38:45", + operator: "系统管理员", + }, + { + id: 36191, + module: "菜单", + content: "菜单列表", + requestUri: "/api/v1/menus", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 39, + createBy: null, + createTime: "2024-07-07 20:38:44", + operator: "系统管理员", + }, + { + id: 36189, + module: "角色", + content: "角色分页列表", + requestUri: "/api/v1/roles/page", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 55, + createBy: null, + createTime: "2024-07-07 20:38:43", + operator: "系统管理员", + }, + { + id: 36188, + module: "用户", + content: "用户分页列表", + requestUri: "/api/v1/users/page", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 92, + createBy: null, + createTime: "2024-07-07 20:38:42", + operator: "系统管理员", + }, + { + id: 36187, + module: "登录", + content: "登录", + requestUri: "/api/v1/auth/login", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 19340, + createBy: null, + createTime: "2024-07-07 20:38:09", + operator: "系统管理员", + }, + { + id: 36186, + module: "登录", + content: "登录", + requestUri: "/api/v1/auth/login", + method: null, + ip: "192.168.31.134", + region: "0 内网IP", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 19869, + createBy: null, + createTime: "2024-07-07 20:37:59", + operator: "系统管理员", + }, + { + id: 36185, + module: "登录", + content: "登录", + requestUri: "/api/v1/auth/login", + method: null, + ip: "112.103.111.59", + region: "黑龙江省 哈尔滨市", + browser: "Chrome 97.0.4692.98", + os: "Android", + executionTime: 96, + createBy: null, + createTime: "2024-07-07 20:37:21", + operator: "系统管理员", + }, + { + id: 36184, + module: "登录", + content: "登录", + requestUri: "/api/v1/auth/login", + method: null, + ip: "114.86.204.190", + region: "上海 上海市", + browser: "Chrome 125.0.0.0", + os: "Windows 10 or Windows Server 2016", + executionTime: 89, + createBy: null, + createTime: "2024-07-07 20:29:37", + operator: "系统管理员", + }, + ], + total: 36188, + }, + msg: "一切ok", + }, + }, + { + url: "logs/visit-trend", + method: ["GET"], + body: { + code: "00000", + data: { + dates: [ + "2024-06-30", + "2024-07-01", + "2024-07-02", + "2024-07-03", + "2024-07-04", + "2024-07-05", + "2024-07-06", + "2024-07-07", + ], + pvList: [1751, 5168, 4882, 5301, 4721, 4885, 1901, 1003], + uvList: null, + ipList: [207, 566, 565, 631, 579, 496, 222, 152], + }, + msg: "一切ok", + }, + }, + + { + url: "logs/visit-stats", + method: ["GET"], + body: { + code: "00000", + data: [ + { + type: "pv", + title: "浏览量", + todayCount: 1003, + totalCount: 36193, + growthRate: -0.35, + granularityLabel: "日", + }, + { + type: "uv", + title: "访客数", + todayCount: 100, + totalCount: 2000, + growthRate: 0, + granularityLabel: "日", + }, + { + type: "ip", + title: "IP数", + todayCount: 152, + totalCount: 3234, + growthRate: -0.2, + granularityLabel: "日", + }, + ], + msg: "一切ok", + }, + }, +]); diff --git a/mock/menu.mock.ts b/mock/menu.mock.ts index ce58226c..a31ef4f7 100644 --- a/mock/menu.mock.ts +++ b/mock/menu.mock.ts @@ -26,7 +26,7 @@ export default defineMock([ name: "User", meta: { title: "用户管理", - icon: "user", + icon: "el-icon-User", hidden: false, keepAlive: true, alwaysShow: false, @@ -144,7 +144,7 @@ export default defineMock([ name: "Https://juejin.cn/post/7228990409909108793", meta: { title: "平台文档(外链)", - icon: "link", + icon: "el-icon-Link", hidden: false, alwaysShow: false, params: null, @@ -443,7 +443,7 @@ export default defineMock([ component: "system/user/index", sort: 1, visible: 1, - icon: "user", + icon: "el-icon-User", redirect: null, perm: null, children: [ diff --git a/mock/stats.mock.ts b/mock/stats.mock.ts deleted file mode 100644 index 7a7e8b28..00000000 --- a/mock/stats.mock.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { defineMock } from "./base"; - -export default defineMock([ - { - url: "stats/visit-trend", - method: ["GET"], - body: { - code: "00000", - data: { - dates: [ - "2024-06-24", - "2024-06-25", - "2024-06-26", - "2024-06-27", - "2024-06-28", - "2024-06-29", - "2024-06-30", - "2024-07-01", - ], - pvList: [1100, 2000, 2400, 3000, 4794, 1779, 1751, 4698], - uvList: null, - ipList: [110, 200, 220, 300, 567, 246, 207, 501], - }, - msg: "一切ok", - }, - }, -]);