From 406deac592bb19e7e70d44c887a759af44169761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 17 Sep 2024 13:14:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:api=E5=A4=96=E7=9A=84=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/network/passive-websocket.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/onebot/network/passive-websocket.ts b/src/onebot/network/passive-websocket.ts index 115a432a..35b9045e 100644 --- a/src/onebot/network/passive-websocket.ts +++ b/src/onebot/network/passive-websocket.ts @@ -48,8 +48,8 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter { //鉴权 this.authorize(token, wsClient, wsReq); const paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url; - const isEventConnect = paramUrl === '/event' || paramUrl === '' || paramUrl === '/'; - if (isEventConnect) { + const isApiConnect = paramUrl === '/api' || paramUrl === '/api/'; + if (!isApiConnect) { this.connectEvent(core, wsClient); } @@ -77,7 +77,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter { }); }); await this.wsClientsMutex.runExclusive(async () => { - if(isEventConnect){ + if(!isApiConnect){ this.wsClientWithEvent.push(wsClient); } this.wsClients.push(wsClient);