|
@@ -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) {
|