This commit is contained in:
laodaming 2023-08-18 15:02:08 +08:00
parent 4060b5775b
commit a19d526e72

View File

@ -94,7 +94,7 @@ func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request)
) )
isAuth, userInfo = l.checkAuth(r) isAuth, userInfo = l.checkAuth(r)
if !isAuth { if !isAuth {
//time.Sleep(time.Second * 1) //兼容下火狐 time.Sleep(time.Second * 1) //兼容下火狐
rsp := websocket_data.DataTransferData{ rsp := websocket_data.DataTransferData{
T: constants.WEBSOCKET_UNAUTH, T: constants.WEBSOCKET_UNAUTH,
D: nil, D: nil,
@ -151,7 +151,7 @@ func (l *DataTransferLogic) setConnPool(conn *websocket.Conn, userInfo auth.User
mapConnPool.Store(uniqueId, ws) mapConnPool.Store(uniqueId, ws)
go func() { go func() {
//把连接成功消息发回去 //把连接成功消息发回去
//time.Sleep(time.Second * 1) //兼容下火狐 time.Sleep(time.Second * 1) //兼容下火狐
ws.sendToOutChan(ws.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, uniqueId)) ws.sendToOutChan(ws.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, uniqueId))
}() }()
return ws return ws