setShow不放到onOpen

This commit is contained in:
unknown
2022-06-16 16:01:12 +08:00
parent 0c68518827
commit 88ba3ccd6a

View File

@ -255,6 +255,7 @@ const getToken = ()=>{
supplierNo:kfType==1?'EMPTY':agentNumber
}).then(res => {
if (res && res.success) {
setShow(true)
websocketInit(staffId)
setLoading(true)
getMoreMessage(1)
@ -281,7 +282,6 @@ const monitorWebSocket = (ws)=>{
console.log("Connection open ...");
//记录ws
CUSTOMERSERVICE_WEBSOCKET.push(ws)
setShow(true) //连接建立后,才可以显示弹窗、收发消息
}
// 接收服务端数据时触发事件
ws.onmessage = function (res) {