mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-15 04:40:34 +00:00
build: 1.3.5-re
This commit is contained in:
parent
84b7e82446
commit
7194f31cb6
@ -45,7 +45,7 @@ class OB11WebsocketServer extends WebsocketServerBase {
|
|||||||
wsClient.on('message', async (msg) => {
|
wsClient.on('message', async (msg) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
let receiveData: { action: ActionName, params: any, echo?: any } = { action: '', params: {} };
|
let receiveData: { action: ActionName, params?: any, echo?: any } = { action: '', params: {} };
|
||||||
let echo = null;
|
let echo = null;
|
||||||
try {
|
try {
|
||||||
receiveData = JSON.parse(msg.toString());
|
receiveData = JSON.parse(msg.toString());
|
||||||
@ -54,6 +54,7 @@ class OB11WebsocketServer extends WebsocketServerBase {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wsReply(wsClient, OB11Response.error('json解析失败,请检查数据格式', 1400, echo));
|
return wsReply(wsClient, OB11Response.error('json解析失败,请检查数据格式', 1400, echo));
|
||||||
}
|
}
|
||||||
|
receiveData.params = (receiveData?.params) ? receiveData.params : {};//兼容类型验证
|
||||||
this.handleAction(wsClient, receiveData.action, receiveData.params, receiveData.echo).then();
|
this.handleAction(wsClient, receiveData.action, receiveData.params, receiveData.echo).then();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user