Ver código fonte

新增退出api

gemercheung 2 anos atrás
pai
commit
4b07930924
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      socket.js

+ 7 - 3
socket.js

@@ -650,8 +650,13 @@ export default {
       this.setData({
         roomDisMiss: true
       })
+      try {
+        this.exitRoomApi();
+      } catch (error) {
+        console.log('error', error)
+      }
 
-      // this.exitRoom();
+      //  this.exitRoom();
     })
 
     //服务器未知错误重进
@@ -967,7 +972,7 @@ export default {
     }
 
   },
-
+  // 一些情况下单调API退出
   exitRoomApi() {
     const roomId = this.data.socketOptions.roomId;
     const role = this.role;
@@ -975,7 +980,6 @@ export default {
       businessId: roomId
     }, 'POST', 'application/json');
 
-
   },
   async exit() {
     // this.stopCall()