房间socket代码修改

This commit is contained in:
joylink_cuiweidong 2020-01-16 16:15:58 +08:00
parent 5357d5c23c
commit 1cd35488e8

View File

@ -186,8 +186,10 @@ export default {
this.members.push(this.transformUser(user)); this.members.push(this.transformUser(user));
} }
} else { } else {
this.checkUserState(user, this.members[index]); if (this.members[index]) {
this.members.splice(index, 1); this.checkUserState(user, this.members[index]);
this.members.splice(index, 1);
}
} }
}); });
}, },
@ -222,7 +224,6 @@ export default {
session: 'session', session: 'session',
oneself: user.id === this.$store.state.user.id oneself: user.id === this.$store.state.user.id
}; };
if (old) { if (old) {
if (!user.userRole) { if (!user.userRole) {
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}被提出房间`}); this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}被提出房间`});