mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-09-28 04:05:12 +00:00
fix:api外的推送事件
This commit is contained in:
parent
e719ae0676
commit
406deac592
@ -48,8 +48,8 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
//鉴权
|
//鉴权
|
||||||
this.authorize(token, wsClient, wsReq);
|
this.authorize(token, wsClient, wsReq);
|
||||||
const paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url;
|
const paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url;
|
||||||
const isEventConnect = paramUrl === '/event' || paramUrl === '' || paramUrl === '/';
|
const isApiConnect = paramUrl === '/api' || paramUrl === '/api/';
|
||||||
if (isEventConnect) {
|
if (!isApiConnect) {
|
||||||
this.connectEvent(core, wsClient);
|
this.connectEvent(core, wsClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
await this.wsClientsMutex.runExclusive(async () => {
|
await this.wsClientsMutex.runExclusive(async () => {
|
||||||
if(isEventConnect){
|
if(!isApiConnect){
|
||||||
this.wsClientWithEvent.push(wsClient);
|
this.wsClientWithEvent.push(wsClient);
|
||||||
}
|
}
|
||||||
this.wsClients.push(wsClient);
|
this.wsClients.push(wsClient);
|
||||||
|
Loading…
Reference in New Issue
Block a user