From a481bec282df3df532c944e68fd573068acab665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 29 Aug 2023 21:36:11 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=E4=BC=98=E5=8C=96=E5=BC=BA=E9=80=80?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E=E6=89=B9=E9=87=8F=E5=BC=BA?= =?UTF-8?q?=E9=80=80=E5=9C=A8=E7=BA=BF=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/monitor/online.js | 9 ++++++++ src/signalr/signalr.js | 4 ++-- src/store/modules/user.js | 2 +- src/views/index.vue | 2 +- src/views/monitor/onlineuser/index.vue | 32 +++++++++++++++++++------- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js index d51b88d..d173100 100644 --- a/src/api/monitor/online.js +++ b/src/api/monitor/online.js @@ -17,3 +17,12 @@ export function forceLogout(data) { data: data }) } + +// 批量强退用户 +export function forceLogoutAll(data) { + return request({ + url: '/monitor/online/batchlock', + method: 'delete', + data: data + }) +} diff --git a/src/signalr/signalr.js b/src/signalr/signalr.js index bec87ad..85de1d8 100644 --- a/src/signalr/signalr.js +++ b/src/signalr/signalr.js @@ -2,7 +2,7 @@ import * as signalR from '@microsoft/signalr' import { getToken } from '@/utils/auth' import { ElMessage } from 'element-plus' - +import cache from '@/plugins/cache' import analysis from '@/signalr/analysis' export default { @@ -11,7 +11,7 @@ export default { // 失败连接重试次数 failNum: 4, init(url) { - var socketUrl = window.location.origin + url + var socketUrl = window.location.origin + url + '?clientId=' + cache.local.get('clientId') const connection = new signalR.HubConnectionBuilder() .withUrl(socketUrl, { accessTokenFactory: () => getToken() }) .withAutomaticReconnect() //自动重新连接 diff --git a/src/store/modules/user.js b/src/store/modules/user.js index f89b313..7edfe1e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -107,7 +107,7 @@ const useUserStore = defineStore('user', { resolve(res) }) .catch((error) => { - console.error(error) + console.warn(error) reject('获取用户信息失败') }) }) diff --git a/src/views/index.vue b/src/views/index.vue index e6b6f46..d72142f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -39,7 +39,7 @@

ZRAdmin.NET {{ $t('layout.backstageManagement') }}

ZRAdmin.NET借鉴了很多开源项目的优点,让你开发Web管理系统更简单,所以我也把它给开源了(前端 - vue页面主要使用了若依,后端参考Ruoyi stringboot版本,在此表示感谢.) + vue页面主要使用了若依,后端参考Ruoyi StringBoot版本,在此表示感谢.)

{{ $t('layout.content1') }}

diff --git a/src/views/monitor/onlineuser/index.vue b/src/views/monitor/onlineuser/index.vue index 2614400..ca024ad 100644 --- a/src/views/monitor/onlineuser/index.vue +++ b/src/views/monitor/onlineuser/index.vue @@ -5,7 +5,11 @@ 刷新 - + + + 全部强退 + + @@ -17,7 +21,7 @@ - +