操作日志和访问日志

This commit is contained in:
2025-11-11 22:32:46 +08:00
parent efc079c0e5
commit 12a0ff8afc
17 changed files with 2300 additions and 4 deletions
+36
View File
@@ -0,0 +1,36 @@
import request from '@/utils/request'
// 获取访问日志列表
export function getAccessLogs(params) {
return request({
url: '/api/access-logs',
method: 'get',
params
})
}
// 根据ID获取访问日志详情
export function getAccessLogById(id) {
return request({
url: `/api/access-logs/${id}`,
method: 'get'
})
}
// 获取用户访问统计
export function getUserAccessStats(params) {
return request({
url: '/api/access-logs/user/stats',
method: 'get',
params
})
}
// 清空旧访问日志
export function clearOldAccessLogs(keepDays = 90) {
return request({
url: '/api/access-logs/clear',
method: 'post',
data: { keep_days: keepDays }
})
}
+45
View File
@@ -0,0 +1,45 @@
import request from '@/utils/request'
// 获取操作日志列表
export function getOperationLogs(params) {
return request({
url: '/api/operation-logs',
method: 'get',
params
})
}
// 根据ID获取操作日志详情
export function getOperationLogById(id) {
return request({
url: `/api/operation-logs/${id}`,
method: 'get'
})
}
// 获取用户操作统计
export function getUserOperationStats(params) {
return request({
url: '/api/operation-logs/user/stats',
method: 'get',
params
})
}
// 获取租户操作统计
export function getTenantOperationStats(params) {
return request({
url: '/api/operation-logs/tenant/stats',
method: 'get',
params
})
}
// 清空旧日志
export function clearOldLogs(keepDays = 90) {
return request({
url: '/api/operation-logs/clear',
method: 'post',
data: { keep_days: keepDays }
})
}