Files
orion-visor/orion-ops-ui/src/api/user/operator-log.ts

69 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-10-31 19:07:48 +08:00
import type { DataGrid, Pagination } from '@/types/global';
import axios from 'axios';
/**
*
*/
export interface OperatorLogQueryRequest extends Pagination {
userId?: number;
username?: string;
module?: string;
type?: string;
riskLevel?: string;
result?: number;
startTimeStart?: string;
startTimeEnd?: string;
}
/**
*
*/
export interface OperatorLogQueryResponse {
id: number;
userId: number;
username: string;
traceId: string;
address: string;
location: string;
userAgent: string;
riskLevel: string;
module: string;
type: string;
logInfo: string;
extra: string;
result: number;
errorMessage: string;
returnValue: string;
duration: number;
startTime: number;
endTime: number;
createTime: number;
}
/**
*
*/
export interface LoginHistoryQueryResponse {
id: number;
address: string;
location: string;
userAgent: string;
result: number;
errorMessage: string;
createTime: number;
}
/**
*
*/
export function getOperatorLogPage(request: OperatorLogQueryRequest) {
return axios.post<DataGrid<OperatorLogQueryResponse>>('/infra/operator-log/query', request);
}
/**
*
*/
export function getLoginHistory(username: string) {
return axios.get<LoginHistoryQueryResponse[]>('/infra/operator-log/login-history', { params: { username } });
}