This commit is contained in:
laodaming
2023-08-09 15:29:27 +08:00
parent 2d0d410c40
commit fcf7c909a3
3 changed files with 28 additions and 16 deletions

View File

@@ -85,7 +85,7 @@ func (l *DataTransferLogic) DataTransfer(svcCtx *svc.ServiceContext, w http.Resp
}
defer conn.Close()
//鉴权不成功10秒后断开
var (
/*var (
userInfo *auth.UserInfo
isAuth bool
)
@@ -102,10 +102,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*/
var userInfo auth.UserInfo
userInfo.UserId = 39
//生成连接唯一标识
uniqueId := websocketIdGenerator.Get()
ws := wsConnectItem{