细节优化
This commit is contained in:
@@ -90,7 +90,6 @@ async function onReceiveMessage(content) {
|
||||
messages.forEach((msg) => {
|
||||
if (
|
||||
msg.roomNumber === roomNumber.value ||
|
||||
(battleId.value && msg.id === battleId.value) ||
|
||||
msg.constructor === MESSAGETYPES.WaitForAllReady
|
||||
) {
|
||||
console.log("收到消息:", msg);
|
||||
@@ -187,9 +186,9 @@ onMounted(() => {
|
||||
onUnmounted(() => {
|
||||
uni.$off("socket-inbox", onReceiveMessage);
|
||||
if (owner.value) {
|
||||
destroyRoomAPI(room.value.id);
|
||||
destroyRoomAPI(roomNumber.value);
|
||||
} else {
|
||||
exitRoomAPI(room.value.id);
|
||||
exitRoomAPI(roomNumber.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user