fix
This commit is contained in:
parent
646a42150f
commit
ae4d8b7fb2
|
@ -259,11 +259,6 @@ func (l *DataTransferLogic) setConnPool(conn *websocket.Conn, userInfo *auth.Use
|
||||||
return ws, nil
|
return ws, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取websocket发送到前端使用的数据传输类型(debug开启是文本,否则是二进制)
|
|
||||||
func getWebsocketBaseTransferDataFormat() int {
|
|
||||||
return websocket.TextMessage
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取唯一id
|
// 获取唯一id
|
||||||
func (l *DataTransferLogic) getUniqueId(userInfo *auth.UserInfo, userAgent string, retryTimes int) (uniqueId string, err error) {
|
func (l *DataTransferLogic) getUniqueId(userInfo *auth.UserInfo, userAgent string, retryTimes int) (uniqueId string, err error) {
|
||||||
if retryTimes < 0 {
|
if retryTimes < 0 {
|
||||||
|
|
|
@ -18,7 +18,7 @@ func (l *DataTransferLogic) sendGetUniqueIdErrResponse(conn *websocket.Conn, deb
|
||||||
}
|
}
|
||||||
b, _ := json.Marshal(rsp)
|
b, _ := json.Marshal(rsp)
|
||||||
//先发一条正常信息
|
//先发一条正常信息
|
||||||
_ = conn.WriteMessage(getWebsocketBaseTransferDataFormat(), b)
|
_ = conn.WriteMessage(websocket.TextMessage, b)
|
||||||
//发送关闭信息
|
//发送关闭信息
|
||||||
_ = conn.WriteMessage(websocket.CloseMessage, nil)
|
_ = conn.WriteMessage(websocket.CloseMessage, nil)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func (l *DataTransferLogic) unAuthResponse(conn *websocket.Conn, isFirefoxBrowse
|
||||||
time.Sleep(time.Second * 1) //兼容下火狐(直接发回去收不到第一条消息:有待研究)
|
time.Sleep(time.Second * 1) //兼容下火狐(直接发回去收不到第一条消息:有待研究)
|
||||||
}
|
}
|
||||||
//先发一条正常信息
|
//先发一条正常信息
|
||||||
_ = conn.WriteMessage(getWebsocketBaseTransferDataFormat(), b)
|
_ = conn.WriteMessage(websocket.TextMessage, b)
|
||||||
//发送关闭信息
|
//发送关闭信息
|
||||||
_ = conn.WriteMessage(websocket.CloseMessage, nil)
|
_ = conn.WriteMessage(websocket.CloseMessage, nil)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user