feat: 操作日志
This commit is contained in:
40
apps/web-antd/src/api/monitor/online/index.ts
Normal file
40
apps/web-antd/src/api/monitor/online/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { OnlineUser } from './model';
|
||||
|
||||
import type { PageQuery } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
onlineList = '/monitor/online/list',
|
||||
root = '/monitor/online',
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前账号的在线设备 个人中心使用
|
||||
* @returns OnlineUser[]
|
||||
*/
|
||||
export function onlineDeviceList() {
|
||||
return requestClient.get<OnlineUser[]>(Api.root);
|
||||
}
|
||||
|
||||
export function onlineList(params?: PageQuery) {
|
||||
return requestClient.get<OnlineUser[]>(Api.onlineList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制下线
|
||||
* @param tokenId 用户token
|
||||
* @returns void
|
||||
*/
|
||||
export function forceLogout(tokenId: string) {
|
||||
return requestClient.delete<void>(`${Api.root}/${tokenId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人中心用的 跟上面的不同是用的Post
|
||||
* @param tokenId 用户token
|
||||
* @returns void
|
||||
*/
|
||||
export function forceLogout2(tokenId: string) {
|
||||
return requestClient.post<void>(`${Api.root}/${tokenId}`);
|
||||
}
|
10
apps/web-antd/src/api/monitor/online/model.d.ts
vendored
Normal file
10
apps/web-antd/src/api/monitor/online/model.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface OnlineUser {
|
||||
tokenId: string;
|
||||
deptName: string;
|
||||
userName: string;
|
||||
ipaddr: string;
|
||||
loginLocation: string;
|
||||
browser: string;
|
||||
os: string;
|
||||
loginTime: number;
|
||||
}
|
31
apps/web-antd/src/api/monitor/operlog/index.ts
Normal file
31
apps/web-antd/src/api/monitor/operlog/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { OperationLog } from './model';
|
||||
|
||||
import type { IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
operLogClean = '/monitor/operlog/clean',
|
||||
operLogExport = '/monitor/operlog/export',
|
||||
operLogList = '/monitor/operlog/list',
|
||||
root = '/monitor/operlog',
|
||||
}
|
||||
|
||||
export function operLogList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<OperationLog>>(Api.operLogList, {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function operLogDelete(operIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`${Api.root}/${operIds}`);
|
||||
}
|
||||
|
||||
export function operLogClean() {
|
||||
return requestClient.deleteWithMsg<void>(Api.operLogClean);
|
||||
}
|
||||
|
||||
export function operLogExport(data: any) {
|
||||
return commonExport(Api.operLogExport, data);
|
||||
}
|
21
apps/web-antd/src/api/monitor/operlog/model.d.ts
vendored
Normal file
21
apps/web-antd/src/api/monitor/operlog/model.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
export interface OperationLog {
|
||||
operId: string;
|
||||
tenantId: string;
|
||||
title: string;
|
||||
businessType: number;
|
||||
businessTypes?: any;
|
||||
method: string;
|
||||
requestMethod: string;
|
||||
operatorType: number;
|
||||
operName: string;
|
||||
deptName: string;
|
||||
operUrl: string;
|
||||
operIp: string;
|
||||
operLocation: string;
|
||||
operParam: string;
|
||||
jsonResult: string;
|
||||
status: number;
|
||||
errorMsg: string;
|
||||
operTime: string;
|
||||
costTime: number;
|
||||
}
|
Reference in New Issue
Block a user