Skip to content

Commit

Permalink
build: 1.3.5-re
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed May 19, 2024
1 parent 84b7e82 commit 7194f31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/onebot11/server/ws/WebsocketServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class OB11WebsocketServer extends WebsocketServerBase {
wsClient.on('message', async (msg) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @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;
try {
receiveData = JSON.parse(msg.toString());
Expand All @@ -54,6 +54,7 @@ class OB11WebsocketServer extends WebsocketServerBase {
} catch (e) {
return wsReply(wsClient, OB11Response.error('json解析失败,请检查数据格式', 1400, echo));
}
receiveData.params = (receiveData?.params) ? receiveData.params : {};//兼容类型验证
this.handleAction(wsClient, receiveData.action, receiveData.params, receiveData.echo).then();
});
}
Expand Down

0 comments on commit 7194f31

Please sign in to comment.