diff --git a/App.vue b/App.vue index fcef6e6..7eb0a2f 100644 --- a/App.vue +++ b/App.vue @@ -172,9 +172,9 @@ export default { buildWsUrl() { const protocol = window.location.protocol.indexOf("https") === 0 ? "wss" : "ws"; - const userId = + const Id = (this.vuex_user && (this.vuex_user.id || this.vuex_user.Id)) || ""; - return `${protocol}://120.55.234.65:8082/api/Dialogue/HandleConnection?Id=${userId}`; // &equipmentType=0 + return `${protocol}://120.55.234.65:8082/api/Dialogue/HandleConnection?Id=${Id}`; // &equipmentType=0 }, // 初始化原生 WebSocket 连接 initWebSocket() { @@ -308,6 +308,8 @@ export default { }, // 连接错误 handleWsError(e) { + console.log("[WebSocket] 连接错误:", e); + this.lockReconnect = false; this.reconnect(); },