diff --git a/h5/activity/room-turnover-reward/index.html b/h5/activity/room-turnover-reward/index.html index de47a22..63efe99 100644 --- a/h5/activity/room-turnover-reward/index.html +++ b/h5/activity/room-turnover-reward/index.html @@ -489,7 +489,7 @@ const DEFAULT_API_BASE = "https://jvapi.haiyihy.com/"; const DEFAULT_API_PREFIX = "/go"; const DEFAULT_AVATAR = "../../assets/defaultAvatar-CdxWBK1k.png"; - const query = new URLSearchParams(window.location.search); + const query = buildPageQueryParams(); const resolvedAPIBase = resolveAPIBase(); const fallbackLevels = Array.from({ length: 7 }, (_, index) => ({ level: index + 1, @@ -525,6 +525,21 @@ return value == null ? "" : String(value).trim(); } + function buildPageQueryParams() { + const params = new URLSearchParams(window.location.search); + const hash = window.location.hash || ""; + const queryIndex = hash.indexOf("?"); + if (queryIndex >= 0) { + const hashParams = new URLSearchParams(hash.slice(queryIndex + 1)); + hashParams.forEach((value, key) => { + if (!params.has(key)) { + params.append(key, value); + } + }); + } + return params; + } + function textFromQuery(keys, fallback) { for (const key of keys) { const value = trimValue(query.get(key)); @@ -536,7 +551,11 @@ } function resolveToken() { - return textFromQuery(["token", "accessToken", "authorization"], ""); + const token = textFromQuery(["token", "accessToken", "authorization"], ""); + if (token.toLowerCase().startsWith("bearer ")) { + return "Bearer " + token.slice(7).replace(/ /g, "+"); + } + return token.replace(/ /g, "+"); } function numberFromQuery(keys, fallback) {