房间socket代码修改

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

View File

@ -186,9 +186,11 @@ export default {
this.members.push(this.transformUser(user)); this.members.push(this.transformUser(user));
} }
} else { } else {
if (this.members[index]) {
this.checkUserState(user, this.members[index]); this.checkUserState(user, this.members[index]);
this.members.splice(index, 1); this.members.splice(index, 1);
} }
}
}); });
}, },
async dispatchRoomInfo(room) { async dispatchRoomInfo(room) {
@ -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}被提出房间`});