gemercheung 3 лет назад
Родитель
Сommit
83213ba300
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/controller/room/index.js

+ 4 - 2
src/controller/room/index.js

@@ -119,7 +119,7 @@ export class RoomController extends BasicController {
 
       if (this.isHoster(this.user.role)) {
         if ([FROMTYPE.MiniAPP].includes(Number(this.user.from))) {
-          const roomConfig = getRoomConfig(this.roomId);
+          const roomConfig = await getRoomConfig(this.roomId);
           const checkoutMaster = await isRoomMaster(this.roomId, this.userId);
           const isNoExistMaster = "masterId" in roomConfig;
           // console.log("checkoutMaster-isNoExistMaster", checkoutMaster, !isNoExistMaster);
@@ -133,6 +133,8 @@ export class RoomController extends BasicController {
             console.log("roomConfig", roomConfig);
             // console.log("roomConfig", roomConfig);
             await setRoomConfig(this.roomId, roomConfig);
+          } else {
+            console.error("存在非法房主", this.user);
           }
         }
       }
@@ -351,7 +353,7 @@ export class RoomController extends BasicController {
         const AllRoomUsers = await getAllRoomUsers(this.roomId);
         // 房主
         if (this.isHoster(this.user.role)) {
-          console.log("自动接连", this.roomId, this.user.from);
+          this.logger.info("自动接连", this.roomId, this.user.from);
           this.socket.join(this.roomId);
 
           this.socket.emit("autoReJoin", {