diff --git a/src/apis/index.ts b/src/apis/index.ts index 7a1115c..8cb69aa 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -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' diff --git a/src/apis/monitor/index.ts b/src/apis/monitor/index.ts new file mode 100644 index 0000000..bbba779 --- /dev/null +++ b/src/apis/monitor/index.ts @@ -0,0 +1 @@ +export * from './online' diff --git a/src/apis/monitor/online.ts b/src/apis/monitor/online.ts new file mode 100644 index 0000000..761338d --- /dev/null +++ b/src/apis/monitor/online.ts @@ -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>(`${BASE_URL}`, query) +} + +/** @desc 强退在线用户 */ +export function kickout(token: string) { + return http.del(`${BASE_URL}/${token}`) +} diff --git a/src/apis/monitor/type.ts b/src/apis/monitor/type.ts new file mode 100644 index 0000000..d77bc83 --- /dev/null +++ b/src/apis/monitor/type.ts @@ -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 +} diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue new file mode 100644 index 0000000..03d629b --- /dev/null +++ b/src/views/monitor/online/index.vue @@ -0,0 +1,102 @@ + + + + +