feat: 新增在线用户管理

This commit is contained in:
2024-04-08 22:03:03 +08:00
parent a41a7f32ab
commit 906de765f8
5 changed files with 139 additions and 0 deletions

View File

@@ -1,8 +1,10 @@
export * from './area'
export * from './auth'
export * from './common'
export * from './monitor'
export * from './area/type'
export * from './auth/type'
export * from './common/type'
export * from './monitor/type'

View File

@@ -0,0 +1 @@
export * from './online'

View File

@@ -0,0 +1,14 @@
import http from '@/utils/http'
import type * as Monitor from './type'
const BASE_URL = '/monitor/online/user'
/** @desc 查询在线用户列表 */
export function listOnlineUser(query: Monitor.OnlineUserQuery) {
return http.get<PageRes<Monitor.OnlineUserResp[]>>(`${BASE_URL}`, query)
}
/** @desc 强退在线用户 */
export function kickout(token: string) {
return http.del(`${BASE_URL}/${token}`)
}

20
src/apis/monitor/type.ts Normal file
View File

@@ -0,0 +1,20 @@
/** 在线用户类型 */
export interface OnlineUserResp {
id: string
description: string
module: string
timeTaken: number
ip: string
address: string
browser: string
os: string
status: number
errorMsg: string
createUserString: string
createTime: string
}
export interface OnlineUserQuery extends PageQuery {
nickname?: string
loginTime?: string
}