From 2d98d33b02db8e798b025b4fc47a04660091d60d Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 20 Sep 2020 11:34:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=89=93=E5=8C=85=E5=90=8Ewebsocke?= =?UTF-8?q?t=E5=9C=B0=E5=9D=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/websocket_config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/websocket/websocket_config.js b/src/websocket/websocket_config.js index ef16497..4864810 100644 --- a/src/websocket/websocket_config.js +++ b/src/websocket/websocket_config.js @@ -1,4 +1,9 @@ -const url = process.env.VUE_APP_WEBSOCKET; + +let host = window.location.host; + if (window.location.port.length > 0) { + host = window.location.host.substring(0, window.location.host.length - window.location.port.length - 1) + } +const url = `http://${host}:8088`; let stompClient = ''; let isConnected = false; let timer = '';