chore(douyin-mashida): 联调脚本支持皮肤领取链接
- `set-public-url`:切公网地址时**同时**写 `certLink` 与新的 `claimLinkBase`
(只切前者会让皮肤订单仍指向旧域名的领取页),并打印两者
- `preflight`:新增领取链接自检 —— 未填给 ⚠️(皮肤订单会退回固定兑换链接、
买家又要手输订单号);带 `#` 直接判为阻塞(会把人带到打手领取页);非 https 阻塞
This commit is contained in:
@@ -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) 网关
|
||||
|
||||
@@ -74,13 +74,17 @@ main().catch((error) => {
|
||||
|
||||
async function main(): Promise<void> {
|
||||
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<void> {
|
||||
...stripReadonly(data),
|
||||
certLink,
|
||||
afterVerifyLink: certLink,
|
||||
claimLinkBase,
|
||||
}
|
||||
|
||||
const saved = await api<JsonObject>(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)
|
||||
|
||||
Reference in New Issue
Block a user