diff --git a/apps/backend/scripts/douyin-mashida-preflight.ts b/apps/backend/scripts/douyin-mashida-preflight.ts index d82b8328..1f085fb7 100644 --- a/apps/backend/scripts/douyin-mashida-preflight.ts +++ b/apps/backend/scripts/douyin-mashida-preflight.ts @@ -99,6 +99,8 @@ function step1Config(config: JsonObject): void { const enabled = config.enabled !== false const uid = String(config.uid || '') const certLink = String(config.certLink || '') + // 皮肤订单的领取页基址(路径式,不带 #);留空时皮肤订单会退回固定兑换链接 + const claimLinkBase = String(config.claimLinkBase || '') const baseUrl = String(config.baseUrl || '') const hasSecret = Boolean(config.hasSecret) const ready = Boolean(config.ready) @@ -109,6 +111,9 @@ function step1Config(config: JsonObject): void { ` secret ${hasSecret ? `✅ 已配置(${String(config.secretMasked || '')})` : '❌ 未配置'}`, ) console.log(` certLink ${certLink ? `✅ ${certLink}` : '❌ 未填'}`) + console.log( + ` 领取链接 ${claimLinkBase ? `✅ ${claimLinkBase}` : '⚠️ 未填(皮肤订单会退回 certLink,买家要手输订单号)'}`, + ) console.log(` baseUrl ${baseUrl || '❌ 未填'}`) console.log(` ready ${ready ? '✅ true' : '❌ false'}`) @@ -132,6 +137,18 @@ function step1Config(config: JsonObject): void { if (certLink && !/^https:/i.test(certLink)) { problems.push(`certLink 不是 https(${certLink})——买家手机多半打不开,平台也可能不认`) } + + if (claimLinkBase) { + if (claimLinkBase.includes('#')) { + problems.push( + `领取链接基址带了 #(${claimLinkBase})——\`#/claim\` 是**打手**领取页,` + + '皮肤买家会被带进绑定游戏 UID 的流程;请改成路径式,例如 https://<域名>/claim', + ) + } + if (!/^https:/i.test(claimLinkBase)) { + problems.push(`领取链接基址不是 https(${claimLinkBase})——买家手机多半打不开`) + } + } } // ---------------------------------------------------------------- 2) 网关 diff --git a/apps/backend/scripts/douyin-mashida-set-public-url.ts b/apps/backend/scripts/douyin-mashida-set-public-url.ts index 96d5e8f8..2858e801 100644 --- a/apps/backend/scripts/douyin-mashida-set-public-url.ts +++ b/apps/backend/scripts/douyin-mashida-set-public-url.ts @@ -74,13 +74,17 @@ main().catch((error) => { async function main(): Promise { const certLink = `${publicUrl}/redeem` + // 皮肤订单用「路径式」领取页(不带 #):买家从卡券/消息点进来直接领,不用输订单号。 + // 注意不能沿用 orders.claimBaseUrl(那是 hash 的打手领取页)。 + const claimLinkBase = `${publicUrl}/claim` const messageUrl = `${publicUrl}${MESSAGE_PATH}` console.log('抖音码速达 · 公网联调地址切换') console.log('─'.repeat(72)) console.log(`后台地址 ${apiBase}`) console.log(`公网地址 ${publicUrl}`) - console.log(`certLink ${certLink}`) + console.log(`certLink ${certLink} (通用兜底兑换链接,非皮肤订单用)`) + console.log(`claimLinkBase ${claimLinkBase} (皮肤订单领取页基址)`) const token = String(args.token || '') || (await login()) @@ -92,12 +96,14 @@ async function main(): Promise { ...stripReadonly(data), certLink, afterVerifyLink: certLink, + claimLinkBase, } const saved = await api(token, 'POST', CONFIG_PATH, payload) const savedData = (saved.data ?? {}) as JsonObject console.log( - `\n✅ 已保存:certLink = ${String(savedData.certLink || '')},ready = ${String(savedData.ready)}`, + `\n✅ 已保存:certLink = ${String(savedData.certLink || '')},` + + `claimLinkBase = ${String(savedData.claimLinkBase || '')},ready = ${String(savedData.ready)}`, ) printPlatformChecklist(messageUrl, certLink)