mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
feat(backend): 更新路由前缀和查询参数处理 style(backend): 调整导入顺序和清理无用导入 refactor(frontend): 重构工作台页面交互和样式 fix(frontend): 修复代码生成页面查询表单和表格展示
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
import request from "@/utils/request";
|
|
|
|
const API_PATH = "/monitor/online";
|
|
|
|
const OnlineAPI = {
|
|
// 查询在线用户列表
|
|
getOnlineList(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;
|
|
}
|