mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 20:55:14 +00:00
- 移除不再使用的fastapi-backend.spec文件 - 更新pyproject.toml和requirements.txt中的依赖项注释,增加了对OpenAI API客户端和其他依赖的描述 - 在多个API模块中统一返回类型为单数形式,提升代码一致性 - 更新前端环境配置,调整API基础URL和WebSocket端点为本地地址
53 lines
1018 B
TypeScript
53 lines
1018 B
TypeScript
import request from "@/utils/http";
|
|
|
|
const API_PATH = "/monitor/online";
|
|
|
|
const OnlineAPI = {
|
|
// 查询在线用户列表
|
|
listOnline(query: OnlineUserPageQuery) {
|
|
return request<ApiResponse<PageResult<OnlineUserTable>>>({
|
|
url: `${API_PATH}/list`,
|
|
method: "get",
|
|
params: query,
|
|
});
|
|
},
|
|
|
|
// 强退用户
|
|
deleteOnline(body: string) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/delete`,
|
|
method: "delete",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
// 强退用户
|
|
clearOnline() {
|
|
return request<ApiResponse>({
|
|
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;
|
|
}
|