feat: 添加系统监控-操作日志

This commit is contained in:
xiaoxian521
2024-03-06 12:05:05 +08:00
parent 7a59999dc7
commit 6288e81130
7 changed files with 405 additions and 33 deletions

View File

@@ -734,7 +734,7 @@ export default defineFakeRoute([
title: "menus.hsOperationLog",
name: "OperationLog",
path: "/monitor/operation-logs",
component: "monitor/logs/operation",
component: "monitor/logs/operation/index",
rank: null,
redirect: "",
icon: "ri:history-fill",
@@ -1092,5 +1092,51 @@ export default defineFakeRoute([
}
};
}
},
// 操作日志
{
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 // 当前页数
}
};
}
}
]);