mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-02 16:57:11 +08:00
新增:新增系统监控/系统日志功能,优化日志表结构
This commit is contained in:
59
continew-admin-ui/src/api/monitor/system-log.ts
Normal file
59
continew-admin-ui/src/api/monitor/system-log.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
|
||||
export interface SystemLogRecord {
|
||||
logId: string;
|
||||
statusCode: number;
|
||||
requestMethod: string;
|
||||
requestUrl: string;
|
||||
elapsedTime: number;
|
||||
clientIp: string;
|
||||
location: string;
|
||||
browser: string;
|
||||
errorMsg: string;
|
||||
exceptionDetail?: string;
|
||||
createUserString: string;
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
export interface SystemLogParams extends Partial<SystemLogRecord> {
|
||||
page: number;
|
||||
size: number;
|
||||
sort: Array<string>;
|
||||
}
|
||||
|
||||
export interface SystemLogListRes {
|
||||
list: SystemLogRecord[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function querySystemLogList(params: SystemLogParams) {
|
||||
return axios.get<SystemLogListRes>('/monitor/log/system', {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export interface SystemLogDetailRecord {
|
||||
logId: string;
|
||||
description: string;
|
||||
requestUrl: string;
|
||||
requestMethod: string;
|
||||
requestHeaders: string;
|
||||
requestBody: string;
|
||||
statusCode: number;
|
||||
responseHeaders: string;
|
||||
responseBody: string;
|
||||
elapsedTime: number;
|
||||
clientIp: string;
|
||||
location: string;
|
||||
browser: string;
|
||||
createUserString: string;
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
export function querySystemLogDetail(logId: string) {
|
||||
return axios.get<SystemLogDetailRecord>(`/monitor/log/system/${logId}`);
|
||||
}
|
||||
Reference in New Issue
Block a user