feat(logs): 日志管理增加筛选维度(操作人/角色/请求方法)

- 后端 querySystemLogs 支持 role/method 过滤;新增 distinctRoles/distinctActors
- 关键词搜索补充 target_name 匹配
- /api/system-logs 返回 roles 与 actors 供前端下拉
- 前端独立筛选工具条:操作人/角色/动作/方法/结果/日期范围 + 清除筛选
- 结束日期改为当日 23:59:59 含当天
This commit is contained in:
freedakgmail
2026-06-14 10:27:24 +08:00
parent 3716564b58
commit f42c04da8b
4 changed files with 94 additions and 26 deletions
+6 -1
View File
@@ -1008,16 +1008,21 @@ export interface SystemLogPage {
page: number;
pageSize: number;
actions: string[];
roles: string[];
actors: Array<{ id: string; name: string }>;
}
/** 查询系统操作审计日志(系统管理员)。 */
export async function fetchSystemLogs(params: {
page: number; pageSize: number; actorId?: string; action?: string; q?: string; from?: string; to?: string; success?: 'true' | 'false';
page: number; pageSize: number; actorId?: string; action?: string; role?: string; method?: string; q?: string; from?: string; to?: string; success?: 'true' | 'false';
}): Promise<SystemLogPage> {
const sp = new URLSearchParams();
sp.set('page', String(params.page));
sp.set('pageSize', String(params.pageSize));
if (params.action) sp.set('action', params.action);
if (params.actorId) sp.set('actorId', params.actorId);
if (params.role) sp.set('role', params.role);
if (params.method) sp.set('method', params.method);
if (params.q) sp.set('q', params.q);
if (params.from) sp.set('from', params.from);
if (params.to) sp.set('to', params.to);