mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-13 20:51:09 +00:00
feat: 重构前端项目结构并优化代码
refactor: 迁移前端资源文件至web目录 feat: 新增多种图标资源 style: 统一代码风格和格式化配置 docs: 更新README和文档说明 chore: 更新依赖和配置文件 fix: 修复部分类型定义和枚举 perf: 优化路由和组件加载逻辑
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/monitor/online';
|
||||
|
||||
const OnlineAPI = {
|
||||
/**
|
||||
* 查询所有在线用户列表
|
||||
* @returns 所有在线用户列表
|
||||
*/
|
||||
listOnline(query: OnlineUserPageQuery) {
|
||||
return request<PageResult<OnlineUserTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 强退用户
|
||||
* @param body 用户会话ID列表
|
||||
*/
|
||||
deleteOnline(body: string) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 强退所有在线用户
|
||||
*/
|
||||
clearOnline() {
|
||||
return request({
|
||||
url: `${API_PATH}/clear`,
|
||||
method: 'delete',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default OnlineAPI;
|
||||
|
||||
export interface OnlineUserPageQuery extends PageQuery {
|
||||
ipaddr?: string;
|
||||
name?: string;
|
||||
login_location?: string;
|
||||
}
|
||||
|
||||
export interface OnlineUserTable {
|
||||
session_id: string;
|
||||
user_id: number;
|
||||
name: string;
|
||||
user_name: string;
|
||||
ipaddr: string;
|
||||
login_location: string;
|
||||
os: string;
|
||||
browser: string;
|
||||
login_time: string;
|
||||
login_type: string;
|
||||
}
|
||||
Reference in New Issue
Block a user