From 215a612b06de46c012361477a46aba6bb68ea793 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Fri, 9 Oct 2026 15:07:03 +0800 Subject: [PATCH] =?UTF-8?q?chore(douyin-mashida):=20=E8=81=94=E8=B0=83?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=94=AF=E6=8C=81=E7=9A=AE=E8=82=A4=E9=A2=86?= =?UTF-8?q?=E5=8F=96=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `set-public-url`:切公网地址时**同时**写 `certLink` 与新的 `claimLinkBase` (只切前者会让皮肤订单仍指向旧域名的领取页),并打印两者 - `preflight`:新增领取链接自检 —— 未填给 ⚠️(皮肤订单会退回固定兑换链接、 买家又要手输订单号);带 `#` 直接判为阻塞(会把人带到打手领取页);非 https 阻塞 --- .../backend/scripts/douyin-mashida-preflight.ts | 17 +++++++++++++++++ .../scripts/douyin-mashida-set-public-url.ts | 10 ++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) 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)