This commit is contained in:
laodaming 2023-08-08 19:17:21 +08:00
parent 5faeacd472
commit a50a183b74
2 changed files with 6 additions and 3 deletions

View File

@ -84,7 +84,7 @@ func (l *DataTransferLogic) DataTransfer(svcCtx *svc.ServiceContext, w http.Resp
}
defer conn.Close()
//鉴权不成功10秒后断开
var (
/*var (
userInfo *auth.UserInfo
isAuth bool
)
@ -101,7 +101,10 @@ func (l *DataTransferLogic) DataTransfer(svcCtx *svc.ServiceContext, w http.Resp
//发送关闭信息
_ = conn.WriteMessage(websocket.CloseMessage, nil)
return
}
}*/
//测试的目前写死 39
var userInfo auth.UserInfo
userInfo.UserId = 39
//生成连接唯一标识
uniqueId := websocketIdGenerator.Get()
ws := wsConnectItem{

View File

@ -23,7 +23,7 @@ type renderImageControlChanItem struct {
// 渲染发送到组装数据组装数据
func (w *wsConnectItem) renderImage(data []byte) {
var renderImageData websocket_data.RenderImageReqMsg
var renderImageData websocket_data.AssembleRenderData
if err := json.Unmarshal(data, &renderImageData); err != nil {
w.outChan <- w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, "invalid format of websocket render image message:"+string(data))
logx.Error("invalid format of websocket render image message", err)