From 66a0c2f4d6749e6ff20af0935102dfcdfaa52ee0 Mon Sep 17 00:00:00 2001 From: lianlonggang Date: Wed, 5 Nov 2025 17:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=8B=E8=BD=BD=E9=A1=B5=E9=9D=A2html?= =?UTF-8?q?=E7=9A=84apiurl=E9=97=AE=E9=A2=98=EF=BC=8C=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=9A=82=E6=97=B6=E6=9C=AA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoint.sh | 9 +++++++++ public/static/apps/experEnd.html | 4 ++-- public/static/apps/expertDownLoad.html | 4 ++-- public/static/apps/index.html | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index e6cb21f..d41c878 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -39,5 +39,14 @@ sed -i '/]/a ||g' /var/www/html/index.html +## 在下载页面的静态文件中注入JS +# 1. 创建运行时配置文件 +cat > /var/www/html/static/apps/configApp.js << EOF +// 动态注入运行时配置 +window['downUrl'] = "${VITE_GLOB_API_URL:-http://default-api.com}"; +EOF + +sed -i '/]/a \ No newline at end of file + diff --git a/public/static/apps/index.html b/public/static/apps/index.html index 0b3468f..6a2970d 100644 --- a/public/static/apps/index.html +++ b/public/static/apps/index.html @@ -85,7 +85,7 @@ } } function androidLoad() { - fetch(`https://api-jkglpt.iosp.ydpt.tech/health-system/version/getSysVersionDetailByPackageName?androidOrIos=1&packageName=com.xjjk.healthyclients`) + fetch(window['downUrl']+`/health-system/version/getSysVersionDetailByPackageName?androidOrIos=1&packageName=com.xjjk.healthyclients`) .then(response => { if (!response.ok) { throw new Error('网络响应不正常'); @@ -94,7 +94,7 @@ }) .then(data => { if (data.code === 200) { - window.open(`https://api-jkglpt.iosp.ydpt.tech/file/down/${data.result.appUrl}`) + window.open(window['downUrl']+`/file/down/${data.result.appUrl}`) } else { window.alert('网络异常'); }