gemercheung 2 년 전
부모
커밋
e7fd52345f
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      src/room/actions/actions.service.ts

+ 7 - 2
src/room/actions/actions.service.ts

@@ -16,7 +16,10 @@ export class ActionsService {
 
   async handleAllAction(socket: Socket, data: ActionsParams): Promise<void> {
     const isSocketLeader = () => {
-      return socket.data.user?.Role === 'leader';
+      return (
+        socket.data.user?.Role === 'leader' ||
+        this.roomService._userInfo.Role === 'leader'
+      );
     };
     let roomId = socket.data.user?.RoomId;
     if (!roomId) {
@@ -27,7 +30,9 @@ export class ActionsService {
       );
     }
     this.roomService.logger.warn(
-      `当前--broadcast:${roomId}`,
+      `当前--broadcast:${roomId}, action:${
+        data.type
+      } ,isLeader:${isSocketLeader()}`,
       'handleAllAction',
     );
     switch (data.type) {