From d3cbf2b748d71d5f4c51f370989471d6e86770e5 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 14 Mar 2025 16:39:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=BB=98=E8=AE=A4=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=A4=E6=96=ADbaseUrl=E6=94=AF=E6=8C=81ht?= =?UTF-8?q?tps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/default/config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public/default/config.js b/public/default/config.js index 7696cf78..5c85eb72 100644 --- a/public/default/config.js +++ b/public/default/config.js @@ -10,12 +10,17 @@ * */ (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 + const hostname = window.location.hostname + let host = `${hostname}:33030`; + if (protocol === 'https:') { + host = `${hostname}:33443`; + } // Service Address - sessionStorage.setItem('baseUrl', `http://${host}`); + sessionStorage.setItem('baseUrl', `${protocol}//${host}`); // websocket Address sessionStorage.setItem('wsUrl', `ws://${host}`); })();