:sparkles:优化强退功能新增批量强退在线用户

This commit is contained in:
不做码农
2023-08-29 21:36:11 +08:00
parent f9ee814adc
commit a481bec282
5 changed files with 37 additions and 12 deletions
+2 -2
View File
@@ -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() //自动重新连接