细节优化

This commit is contained in:
kron
2025-07-28 09:02:02 +08:00
parent 7ce8b9c513
commit 0d7a421546
5 changed files with 105 additions and 114 deletions

View File

@@ -1,4 +1,4 @@
import { MESSAGETYPES } from "@/constants";
import { MESSAGETYPES, getMessageTypeName } from "@/constants";
let socket = null;
let heartbeatInterval = null;
let reconnectTimer = null;
@@ -27,6 +27,7 @@ function createWebSocket(token, onMessage) {
if (onMessage) onMessage(data.data.updates);
const msg = data.data.updates[0];
if (!msg) return;
console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
if (msg.constructor === MESSAGETYPES.BackToGame) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];