gemercheung 3 年之前
父節點
當前提交
c86ca7db5f
共有 1 個文件被更改,包括 14 次插入13 次删除
  1. 14 13
      src/controller/room/assistant.js

+ 14 - 13
src/controller/room/assistant.js

@@ -276,19 +276,20 @@ export class RoomAssistant {
    */
    */
   async startCall(roomId, userId, user) {
   async startCall(roomId, userId, user) {
     try {
     try {
-      // if (user.oid) {
-      //   const hasDuplicateUser = await this.getOpenidInRoom(this.roomId, user.oid);
-      //   console.log("hasDuplicateUser-1", typeof hasDuplicateUser);
-      //   if (hasDuplicateUser && hasDuplicateUser.length > 0) {
-      //     this.logger.info("hasDuplicateUser-2", hasDuplicateUser);
-      //     const removeAll = [];
-      //     Array.from(hasDuplicateUser).forEach((duplicateUser) => {
-      //       removeAll.push(removeRoomUser(this.roomId, duplicateUser.userId));
-      //     });
-      //     const res = await Promise.all(removeAll);
-      //     console.log("去重完成", res);
-      //   }
-      // }
+      if (user.oid) {
+        console.log("hasDuplicateUser-存在oid", user.oid);
+        const hasDuplicateUser = await this.getOpenidInRoom(this.roomId, user.oid);
+        console.log("hasDuplicateUser-1", typeof hasDuplicateUser);
+        if (hasDuplicateUser && hasDuplicateUser.length > 0) {
+          this.logger.info("hasDuplicateUser-2", hasDuplicateUser);
+          const removeAll = [];
+          Array.from(hasDuplicateUser).forEach((duplicateUser) => {
+            removeAll.push(removeRoomUser(this.roomId, duplicateUser.userId));
+          });
+          const res = await Promise.all(removeAll);
+          console.log("去重完成", res);
+        }
+      }
 
 
       if (!this.room.isHoster(user.role)) {
       if (!this.room.isHoster(user.role)) {
         this.room.logger.info("不是房主", JSON.stringify(user));
         this.room.logger.info("不是房主", JSON.stringify(user));