This commit is contained in:
laodaming 2023-08-10 15:21:28 +08:00
parent 6e38e0ac70
commit 979c5c9e14

View File

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