feat: 个人信息页面.

This commit is contained in:
lijiahang
2023-10-31 19:07:48 +08:00
parent 6c9aabd4fd
commit 3fef9b8ae2
42 changed files with 647 additions and 148 deletions

View File

@@ -0,0 +1,75 @@
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 } });
}
/**
* 查询当前用户登录日志
*/
export function getCurrentLoginHistory() {
return axios.get<LoginHistoryQueryResponse[]>('/infra/operator-log/current-login-history');
}