gemercheung 2 years ago
parent
commit
e7fd52345f
1 changed files with 7 additions and 2 deletions
  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> {
   async handleAllAction(socket: Socket, data: ActionsParams): Promise<void> {
     const isSocketLeader = () => {
     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;
     let roomId = socket.data.user?.RoomId;
     if (!roomId) {
     if (!roomId) {
@@ -27,7 +30,9 @@ export class ActionsService {
       );
       );
     }
     }
     this.roomService.logger.warn(
     this.roomService.logger.warn(
-      `当前--broadcast:${roomId}`,
+      `当前--broadcast:${roomId}, action:${
+        data.type
+      } ,isLeader:${isSocketLeader()}`,
       'handleAllAction',
       'handleAllAction',
     );
     );
     switch (data.type) {
     switch (data.type) {