perf: log long string

This commit is contained in:
linyuchen 2024-02-21 16:43:10 +08:00
parent e4508ea5c7
commit ebea755731
2 changed files with 5 additions and 5 deletions

View File

@ -35,10 +35,10 @@ export class ReverseWebsocket {
public async onmessage(msg: string) {
let receiveData: { action: ActionName, params: any, echo?: string } = {action: null, params: {}}
let echo = ""
log("收到反向Websocket消息", msg)
try {
receiveData = JSON.parse(msg.toString())
echo = receiveData.echo
log("收到反向Websocket消息", receiveData)
} catch (e) {
return wsReply(this.websocket, OB11Response.error("json解析失败请检查数据格式", 1400, echo))
}

View File

@ -36,10 +36,10 @@ class OB11WebsocketServer extends WebsocketServerBase {
wsClient.on("message", async (msg) => {
let receiveData: { action: ActionName, params: any, echo?: string } = {action: null, params: {}}
let echo = ""
log("收到正向Websocket消息", msg)
try {
receiveData = JSON.parse(msg.toString())
echo = receiveData.echo
log("收到正向Websocket消息", receiveData);
} catch (e) {
return wsReply(wsClient, OB11Response.error("json解析失败请检查数据格式", 1400, echo))
}