From 536d61d7b035eb5fea06241769e7bdbe35886f7e Mon Sep 17 00:00:00 2001 From: 170-carry Date: Thu, 30 Apr 2026 14:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=81=E5=95=86url?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5/coin-seller/index.html | 2 +- h5/hyapp/recharge-center/index.html | 4 ++-- h5/hyapp/recharge-center/script.js | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/h5/coin-seller/index.html b/h5/coin-seller/index.html index 2de7209..3c564ef 100644 --- a/h5/coin-seller/index.html +++ b/h5/coin-seller/index.html @@ -12,7 +12,7 @@ source.searchParams.forEach(function (value, key) { target.searchParams.set(key, value) }) - target.searchParams.set("h5v", "20260429-0331") + target.searchParams.set("h5v", "20260429-0330") target.searchParams.set("apiBase", "https://jvapi.haiyihy.com") target.searchParams.set("goApiBase", "https://jvapi.haiyihy.com/go") diff --git a/h5/hyapp/recharge-center/index.html b/h5/hyapp/recharge-center/index.html index 62204de..40a3ecf 100644 --- a/h5/hyapp/recharge-center/index.html +++ b/h5/hyapp/recharge-center/index.html @@ -4,7 +4,7 @@ Recharge Center - +
@@ -205,6 +205,6 @@
- + diff --git a/h5/hyapp/recharge-center/script.js b/h5/hyapp/recharge-center/script.js index d7d10cf..e028210 100644 --- a/h5/hyapp/recharge-center/script.js +++ b/h5/hyapp/recharge-center/script.js @@ -407,6 +407,12 @@ }; } + function buildRequestURL(baseURL, path) { + const base = `${String(baseURL || API_BASE_URL).replace(/\/+$/, "")}/`; + const target = String(path || "").replace(/^\/+/, ""); + return new URL(target, base).toString(); + } + async function requestBaseJSON(baseURL, path, options = {}) { const token = readRawParam("token"); if (!token) throw new Error(message("missing_token")); @@ -423,7 +429,7 @@ request.body = JSON.stringify(options.body); } - const response = await fetch(new URL(path, `${baseURL}/`).toString(), request); + const response = await fetch(buildRequestURL(baseURL, path), request); const data = await response.json().catch(() => ({})); if (!response.ok || data.status === false) { const error = new Error(data.errorMsg || data.message || `Request failed: ${response.status}`);