From 90e0169eb7afee83f628a62a728b9138418cc430 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 18 Oct 2023 14:35:33 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/datatransferlogic.go | 5 +++-- utils/websocket_data/render_data.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index 86d49b16..45aedd4c 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -452,8 +452,9 @@ func (w *wsConnectItem) sendToInChan(data []byte) { // 格式化为websocket标准返回格式 func (w *wsConnectItem) respondDataFormat(msgType constants.Websocket, data interface{}) []byte { d := websocket_data.DataTransferData{ - T: msgType, - D: data, + T: msgType, + D: data, + OpenDebug: w.debug != nil, } b, _ := json.Marshal(d) return b diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index bcca7309..22fca565 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -4,8 +4,9 @@ import "fusenapi/constants" // websocket数据交互基本数据类型 type DataTransferData struct { - T constants.Websocket `json:"t"` //消息类型 - D interface{} `json:"d"` //传递的消息 + T constants.Websocket `json:"t"` //消息类型 + D interface{} `json:"d"` //传递的消息 + OpenDebug bool `json:"open_debug"` //是否开启debug } // websocket接受要云渲染处理的数据