mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-13 14:57:16 +08:00
新增:新增系统监控/在线用户功能,并优化部分注释规范
This commit is contained in:
35
continew-admin-ui/src/api/monitor/online.ts
Normal file
35
continew-admin-ui/src/api/monitor/online.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
|
||||
export interface OnlineUserRecord {
|
||||
token: string;
|
||||
username: string;
|
||||
nickname: string;
|
||||
clientIp: string;
|
||||
location: string;
|
||||
browser: string;
|
||||
loginTime: string;
|
||||
}
|
||||
|
||||
export interface OnlineUserParams extends Partial<OnlineUserRecord> {
|
||||
page: number;
|
||||
size: number;
|
||||
sort: Array<string>;
|
||||
}
|
||||
export interface OnlineUserListRes {
|
||||
list: OnlineUserRecord[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function queryOnlineUserList(params: OnlineUserParams) {
|
||||
return axios.get<OnlineUserListRes>('/monitor/online/user', {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function kickout(token: string) {
|
||||
return axios.delete(`/monitor/online/user/${token}`);
|
||||
}
|
Reference in New Issue
Block a user