From 0a553546199a1c59848d4e68050bbac42d569f97 Mon Sep 17 00:00:00 2001 From: yangzhe Date: Fri, 5 Dec 2025 11:05:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DWebSocket=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5URL=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/App.vue b/App.vue index 4b6ca40..fcef6e6 100644 --- a/App.vue +++ b/App.vue @@ -172,15 +172,14 @@ export default { buildWsUrl() { const protocol = window.location.protocol.indexOf("https") === 0 ? "wss" : "ws"; - const host = this.$u.http.config.baseUrl; // 后端端口 const userId = (this.vuex_user && (this.vuex_user.id || this.vuex_user.Id)) || ""; - return `${protocol}://${host}/api/Dialogue/HandleConnection?Id=${userId}`; // &equipmentType=0 + return `${protocol}://120.55.234.65:8082/api/Dialogue/HandleConnection?Id=${userId}`; // &equipmentType=0 }, // 初始化原生 WebSocket 连接 initWebSocket() { console.log(this.buildWsUrl()); - + try { this.ws = new WebSocket(this.buildWsUrl()); this.ws.onopen = () => this.handleWsOpen(); @@ -319,7 +318,7 @@ export default { this.vuex_user && (this.vuex_user.id || this.vuex_user.Id); const hasToken = !!this.vuex_token || !!window.localStorage.getItem("token"); - if (hasUser && hasToken) { + if (hasUser && hasToken) { this.initWebSocket(); } else { this.lockReconnect = false;