refactor: 更新API接口与数据结构,统一分页返回格式

This commit is contained in:
Ray.Hao
2026-01-09 00:07:25 +08:00
parent 4a8efc770e
commit a5885d0710
64 changed files with 1085 additions and 910 deletions

View File

@@ -47,55 +47,57 @@ export default defineMock([
return {
code: "00000",
data: {
list: [
{
id: "10001",
userId: 1,
username: "admin",
originalCommand: "跳转到用户管理",
aiProvider: "qwen",
aiModel: "qwen-plus",
parseStatus: 1,
functionCalls: JSON.stringify(
[
{
name: "navigate",
arguments: { path: "/system/user" },
},
],
null,
0
),
explanation: "Mock: 识别到跳转用户管理",
confidence: 0.92,
parseDurationMs: 128,
functionName: "navigate",
functionArguments: JSON.stringify({ path: "/system/user" }),
executeStatus: 1,
ipAddress: "127.0.0.1",
createTime: "2025-12-17 15:00:00",
updateTime: "2025-12-17 15:00:00",
},
{
id: "10002",
userId: 1,
username: "admin",
originalCommand: "获取姓名为张三的用户信息",
aiProvider: "qwen",
aiModel: "qwen-plus",
parseStatus: 0,
functionCalls: "[]",
explanation: "Mock: 解析失败示例",
confidence: 0.2,
parseErrorMessage: "Mock: 无法匹配函数",
parseDurationMs: 256,
executeStatus: 0,
ipAddress: "127.0.0.1",
createTime: "2025-12-17 15:01:00",
updateTime: "2025-12-17 15:01:00",
},
].slice((pageNum - 1) * pageSize, pageNum * pageSize),
data: [
{
id: "10001",
userId: 1,
username: "admin",
originalCommand: "跳转到用户管理",
aiProvider: "qwen",
aiModel: "qwen-plus",
parseStatus: 1,
functionCalls: JSON.stringify(
[
{
name: "navigate",
arguments: { path: "/system/user" },
},
],
null,
0
),
explanation: "Mock: 识别到跳转用户管理",
confidence: 0.92,
parseDurationMs: 128,
functionName: "navigate",
functionArguments: JSON.stringify({ path: "/system/user" }),
executeStatus: 1,
ipAddress: "127.0.0.1",
createTime: "2025-12-17 15:00:00",
updateTime: "2025-12-17 15:00:00",
},
{
id: "10002",
userId: 1,
username: "admin",
originalCommand: "获取姓名为张三的用户信息",
aiProvider: "qwen",
aiModel: "qwen-plus",
parseStatus: 0,
functionCalls: "[]",
explanation: "Mock: 解析失败示例",
confidence: 0.2,
parseErrorMessage: "Mock: 无法匹配函数",
parseDurationMs: 256,
executeStatus: 0,
ipAddress: "127.0.0.1",
createTime: "2025-12-17 15:01:00",
updateTime: "2025-12-17 15:01:00",
},
].slice((pageNum - 1) * pageSize, pageNum * pageSize),
page: {
pageNum,
pageSize,
total,
},
msg: "一切ok",

View File

@@ -2,7 +2,7 @@ import { defineMock } from "./base";
export default defineMock([
{
url: "dept/options",
url: "depts/options",
method: ["GET"],
body: {
code: "00000",
@@ -27,7 +27,7 @@ export default defineMock([
},
{
url: "dept",
url: "depts",
method: ["GET"],
body: {
code: "00000",
@@ -73,7 +73,7 @@ export default defineMock([
// 新增部门
{
url: "dept",
url: "depts",
method: ["POST"],
body({ body }) {
return {
@@ -86,7 +86,7 @@ export default defineMock([
// 获取部门表单数据
{
url: "dept/:id/form",
url: "depts/:id/form",
method: ["GET"],
body: ({ params }) => {
return {
@@ -99,7 +99,7 @@ export default defineMock([
// 修改部门
{
url: "dept/:id",
url: "depts/:id",
method: ["PUT"],
body({ body }) {
return {
@@ -112,7 +112,7 @@ export default defineMock([
// 删除部门
{
url: "dept/:id",
url: "depts/:id",
method: ["DELETE"],
body({ params }) {
return {

View File

@@ -2,19 +2,21 @@ import { defineMock } from "./base";
export default defineMock([
{
url: "dicts/page",
url: "dicts",
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
id: 1,
name: "性别",
dictCode: "gender",
status: 1,
},
],
data: [
{
id: 1,
name: "性别",
dictCode: "gender",
status: 1,
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 1,
},
msg: "一切ok",
@@ -25,19 +27,16 @@ export default defineMock([
* 字典列表
*/
{
url: "dicts",
url: "dicts/options",
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
value: "gender",
label: "性别",
},
],
total: 1,
},
data: [
{
value: "gender",
label: "性别",
},
],
msg: "一切ok",
},
},
@@ -100,37 +99,42 @@ export default defineMock([
// 字典项分页列表
{
url: "dicts/:dictCode/items/page",
url: "dicts/:dictCode/items",
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
id: 1,
dictCode: "gender",
label: "",
value: "1",
sort: 1,
status: 1,
},
{
id: 2,
dictCode: "gender",
label: "女",
value: "2",
sort: 2,
status: 1,
},
{
id: 3,
dictCode: "gender",
label: "保密",
value: "0",
sort: 3,
status: 1,
},
],
data: [
{
id: 1,
dictCode: "gender",
label: "",
value: "1",
sort: 1,
status: 1,
tagType: "P",
},
{
id: 2,
dictCode: "gender",
label: "女",
value: "2",
sort: 2,
status: 1,
tagType: "D",
},
{
id: 3,
dictCode: "gender",
label: "保密",
value: "0",
sort: 3,
status: 1,
tagType: "I",
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 3,
},
msg: "一切ok",
@@ -138,7 +142,7 @@ export default defineMock([
},
// 字典项列表
{
url: "dicts/:dictCode/items",
url: "dicts/:dictCode/items/options",
method: ["GET"],
body: ({ params }) => {
const dictCode = params.dictCode;
@@ -165,17 +169,17 @@ export default defineMock([
{
value: "L",
label: "低",
tag: "info",
tagType: "I",
},
{
value: "M",
label: "中",
tag: "warning",
tagType: "W",
},
{
value: "H",
label: "高",
tag: "danger",
tagType: "D",
},
];
} else if (dictCode == "notice_type") {
@@ -183,32 +187,32 @@ export default defineMock([
{
value: "1",
label: "系统升级",
tag: "success",
tagType: "S",
},
{
value: "2",
label: "系统维护",
tag: "primary",
tagType: "P",
},
{
value: "3",
label: "安全警告",
tag: "danger",
tagType: "D",
},
{
value: "4",
label: "假期通知",
tag: "success",
tagType: "S",
},
{
value: "5",
label: "公司新闻",
tag: "primary",
tagType: "P",
},
{
value: "99",
label: "其他",
tag: "info",
tagType: "I",
},
];
}
@@ -228,7 +232,7 @@ export default defineMock([
return {
code: "00000",
data: null,
msg: "新增字典" + body.name + "成功",
msg: "新增字典" + body.label + "成功",
};
},
},
@@ -254,7 +258,7 @@ export default defineMock([
return {
code: "00000",
data: null,
msg: "修改字典项" + body.name + "成功",
msg: "修改字典项" + body.label + "成功",
};
},
},
@@ -291,7 +295,7 @@ const dictItemMap: Record<string, any> = {
label: "男",
sort: 1,
status: 1,
tagType: "primary",
tagType: "P",
},
2: {
id: 2,
@@ -299,7 +303,7 @@ const dictItemMap: Record<string, any> = {
label: "女",
sort: 2,
status: 1,
tagType: "danger",
tagType: "D",
},
3: {
id: 3,
@@ -307,6 +311,6 @@ const dictItemMap: Record<string, any> = {
label: "保密",
sort: 3,
status: 1,
tagType: "info",
tagType: "I",
},
};

View File

@@ -2,163 +2,165 @@ import { defineMock } from "./base";
export default defineMock([
{
url: "logs/page",
url: "logs",
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: "系统管理员",
},
],
data: [
{
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/dicts",
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/depts",
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",
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",
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: "系统管理员",
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 36188,
},
msg: "一切ok",

View File

@@ -2,143 +2,145 @@ import { defineMock } from "./base";
export default defineMock([
{
url: "notices/page",
url: "notices",
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
id: 1,
title: "v2.12.0 新增系统日志,访问趋势统计功能。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:21",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 2,
title: "v2.13.0 新增菜单搜索。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:22",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 3,
title: "\r\nv2.14.0 新增个人中心。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:23",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 4,
title: "v2.15.0 登录页面改造。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:24",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 5,
title: "v2.16.0 通知公告、字典翻译组件。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:25",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 6,
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
publishStatus: 1,
type: 2,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:26",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 7,
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
publishStatus: 1,
type: 3,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:27",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 8,
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
publishStatus: 1,
type: 4,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:28",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 9,
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
publishStatus: 1,
type: 5,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:29",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 10,
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:30",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
],
data: [
{
id: 1,
title: "v2.12.0 新增系统日志,访问趋势统计功能。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:21",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 2,
title: "v2.13.0 新增菜单搜索。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:22",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 3,
title: "\r\nv2.14.0 新增个人中心。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:23",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 4,
title: "v2.15.0 登录页面改造。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:24",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 5,
title: "v2.16.0 通知公告、字典翻译组件。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:25",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 6,
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
publishStatus: 1,
type: 2,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:26",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 7,
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
publishStatus: 1,
type: 3,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:27",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 8,
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
publishStatus: 1,
type: 4,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:28",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 9,
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
publishStatus: 1,
type: 5,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:29",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
{
id: 10,
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
publishStatus: 1,
type: 1,
publisherName: "系统管理员",
level: "L",
publishTime: "2024-09-30 17:30",
isRead: null,
targetType: 1,
createTime: "2024-09-28 11:21",
revokeTime: "2024-09-30 17:21",
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 10,
},
msg: "一切ok",
@@ -185,20 +187,20 @@ export default defineMock([
},
// 修改通知
{
url: "roles/:id",
url: "notices/:id",
method: ["PUT"],
body({ body }) {
return {
code: "00000",
data: null,
msg: "修改通知" + body.name + "成功",
msg: "修改通知" + body.title + "成功",
};
},
},
// 删除通知
{
url: "roles/:id",
url: "notices/:id",
method: ["DELETE"],
body({ params }) {
return {
@@ -215,54 +217,56 @@ export default defineMock([
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
id: 10,
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
type: 1,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:30",
isRead: 0,
},
{
id: 9,
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
type: 5,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:29",
isRead: 0,
},
{
id: 8,
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
type: 4,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:28",
isRead: 0,
},
{
id: 7,
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
type: 3,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:27",
isRead: 0,
},
{
id: 6,
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
type: 2,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:26",
isRead: 0,
},
],
data: [
{
id: 10,
title: "v2.16.1 版本修复了 WebSocket 重复连接导致的后台线程阻塞问题,优化了通知公告。",
type: 1,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:30",
isRead: 0,
},
{
id: 9,
title: "公司将在 10 月 15 日举办新产品发布会,敬请期待。",
type: 5,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:29",
isRead: 0,
},
{
id: 8,
title: "国庆假期从 10 月 1 日至 10 月 7 日放假,共 7 天。",
type: 4,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:28",
isRead: 0,
},
{
id: 7,
title: "最近发现一些钓鱼邮件,请大家提高警惕,不要点击陌生链接。",
type: 3,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:27",
isRead: 0,
},
{
id: 6,
title: "系统将于本周六凌晨 2 点进行维护,预计维护时间为 2 小时。",
type: 2,
level: "L",
publisherName: "系统管理员",
publishTime: "2024-09-30 17:26",
isRead: 0,
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 10,
},
msg: "一切ok",

View File

@@ -57,103 +57,105 @@ export default defineMock([
},
{
url: "roles/page",
url: "roles",
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,
},
],
data: [
{
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,
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 10,
},
msg: "一切ok",
@@ -214,7 +216,7 @@ export default defineMock([
{
url: "roles/:id/menuIds",
method: ["GET"],
body: ({}) => {
body: () => {
return {
code: "00000",
data: [

View File

@@ -66,37 +66,39 @@ export default defineMock([
},
{
url: "users/page",
url: "users",
method: ["GET"],
body: {
code: "00000",
data: {
list: [
{
id: 2,
username: "admin",
nickname: "系统管理员",
mobile: "17621210366",
gender: 1,
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
roleIds: [2],
},
{
id: 3,
username: "test",
nickname: "测试小用户",
mobile: "17621210366",
gender: 1,
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,
roleIds: [3],
},
],
data: [
{
id: 2,
username: "admin",
nickname: "系统管理员",
mobile: "17621210366",
gender: 1,
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "",
status: 1,
deptId: 1,
roleIds: [2],
},
{
id: 3,
username: "test",
nickname: "测试小用户",
mobile: "17621210366",
gender: 1,
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
email: "youlaitech@163.com",
status: 1,
deptId: 3,
roleIds: [3],
},
],
page: {
pageNum: 1,
pageSize: 10,
total: 2,
},
msg: "一切ok",
@@ -149,7 +151,7 @@ export default defineMock([
return {
code: "00000",
data: null,
msg: "删除用户" + params.id + "成功",
msg: "删除用户" + params.userId + "成功",
};
},
},