diff --git a/h5/assets/coin-lz3Tp0nX-177614866144-transparent.png b/h5/assets/coin-lz3Tp0nX-177614866144-transparent.png index f2eac61..398b8de 100644 Binary files a/h5/assets/coin-lz3Tp0nX-177614866144-transparent.png and b/h5/assets/coin-lz3Tp0nX-177614866144-transparent.png differ diff --git a/h5/mifa-pay/app.js b/h5/mifa-pay/app.js index f683da6..deb1395 100644 --- a/h5/mifa-pay/app.js +++ b/h5/mifa-pay/app.js @@ -1,6 +1,7 @@ const query = readURLParams(); const storedAppId = window.localStorage.getItem("mifa-pay-application-id") || ""; const API_BASE_URL = "https://jvapi.haiyihy.com"; +const LOCAL_API_BASE_URL = "http://127.0.0.1:1100"; const LOGO_SRC = "./mifapay-logo.png"; function readURLParams() { @@ -106,6 +107,20 @@ function readRawParam(name) { } function apiBaseURL() { + const useProdApi = query.get("prod") === "true"; + const isLocalPage = + window.location.protocol === "http:" && + ["localhost", "127.0.0.1", "0.0.0.0", "::1", "[::1]"].includes( + window.location.hostname + ); + if (isLocalPage && !useProdApi) { + return LOCAL_API_BASE_URL; + } + + if (useProdApi) { + return API_BASE_URL; + } + const override = window.MIFAPAY_API_BASE_URL || query.get("apiBase"); return String(override || API_BASE_URL).replace(/\/+$/, ""); }