细节优化

This commit is contained in:
kron
2025-06-15 20:55:34 +08:00
parent 448f88a77e
commit c2b2d0bf99
12 changed files with 52 additions and 14 deletions

View File

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