liujq 3 vuotta sitten
vanhempi
commit
cbff77ed8b
1 muutettua tiedostoa jossa 11 lisäystä ja 11 poistoa
  1. 11 11
      src/pagesQa/msg/chat.jsx

+ 11 - 11
src/pagesQa/msg/chat.jsx

@@ -178,18 +178,18 @@ class Index extends Component {
           const res = data.response || {}
           if (res.code !== 200) {
             msgSocketList.push({msg: res.codeMsg + '|暂无法接收消息,请退出当前页面重新登录~'})
+            that.setState({
+              msgSocketList
+            }, () => {
+              setTimeout(() => {
+                that.setState({
+                  viewId: `item${msgSocketList.length - 1}`
+                }, () => {
+                  that.closeSocket()
+                })
+              }, 100)
+            })
           }
-          that.setState({
-            msgSocketList
-          }, () => {
-            setTimeout(() => {
-              that.setState({
-                viewId: `item${msgSocketList.length - 1}`
-              }, () => {
-                that.closeSocket()
-              })
-            }, 100)
-          })
         }
         // task.close()
       })