细节优化
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user