From 906de765f8b1c137d928b5b66d3b2a9c90c4bec5 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 8 Apr 2024 22:03:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/index.ts | 2 + src/apis/monitor/index.ts | 1 + src/apis/monitor/online.ts | 14 ++++ src/apis/monitor/type.ts | 20 ++++++ src/views/monitor/online/index.vue | 102 +++++++++++++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 src/apis/monitor/index.ts create mode 100644 src/apis/monitor/online.ts create mode 100644 src/apis/monitor/type.ts create mode 100644 src/views/monitor/online/index.vue 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 @@ + + + + +