修改币商url前缀错误
This commit is contained in:
parent
f89aaf39e0
commit
536d61d7b0
@ -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")
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<title>Recharge Center</title>
|
||||
<link rel="stylesheet" href="./style.css?v=20260430-0108" />
|
||||
<link rel="stylesheet" href="./style.css?v=20260430-0109" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="recharge-center" aria-label="Recharge Center" data-i18n-aria="page_label" data-loading="true">
|
||||
@ -205,6 +205,6 @@
|
||||
|
||||
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
|
||||
</div>
|
||||
<script src="./script.js?v=20260430-0108" defer></script>
|
||||
<script src="./script.js?v=20260430-0109" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -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}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user