From ef098b5d0251a92e5ac2285c4c546cc99a96d3a0 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 25 Mar 2025 15:56:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9C=8B=E6=9D=BF=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=95=B0=E5=88=87=E6=8D=A2=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/default/config.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/public/default/config.js b/public/default/config.js index 7696cf78..2b68f927 100644 --- a/public/default/config.js +++ b/public/default/config.js @@ -10,12 +10,19 @@ * */ (function () { - // host = ip:port - // const host = '192.168.8.100:33030'; - const host = `${window.location.hostname}:33030`; + // baseUrl = protocol://ip:port + // baseUrl = 'http://192.168.8.100:33030'; + const protocol = window.location.protocol + let wsprotocol = "ws:" + const hostname = window.location.hostname + let host = `${hostname}:33030`; + if (protocol === 'https:') { + host = `${hostname}:33443`; + wsprotocol = "wss:" + } // Service Address - sessionStorage.setItem('baseUrl', `http://${host}`); + sessionStorage.setItem('baseUrl', `${protocol}//${host}`); // websocket Address - sessionStorage.setItem('wsUrl', `ws://${host}`); + sessionStorage.setItem('wsUrl', `${wsprotocol}//${host}`); })();