chore(douyin-mashida): 公网联调工具链(切地址 + 前置自检)
真实联调必须让平台能主动推到本机,所以需要隧道;这两个脚本把「配置切换」和
「联调前该验的东西」自动化,避免手工漏配(尤其 certLink 漏改、占位密钥没换):
- `douyin-mashida:set-public-url`:把 certLink/afterVerifyLink 切成隧道地址,
打印平台侧要配的三项(message_url / topics / 卡券链接),并自检隧道:
用错误签名打公网地址,期望 401 —— 证明「隧道 → Caddy → 后端 → 验签」通了,
不需要密钥、也不产生真实订单
- `douyin-mashida:preflight`:四步自检
① 配置就绪度(含识别早期联调留下的占位密钥,它会让 hasSecret=true 骗过你)
② 真实网关连通性:平台是先校 uid 再校签名,带 --secret 时若平台报的不是
签名错误即证明签名/密钥正确(正式推送前就能排掉密钥问题)
③ 公网回调可达性 ④ certLink 与公网域名是否一致
- 平台文档只给了 code=10000 表示成功,无完整错误码表,故脚本不翻译码值、
只原样打印,并对实测观测到的码(如 10014)加说明
同时修掉 vite dev server 的一个潜在坑:`VITE_ALLOWED_HOSTS` 早已在 .env 与
compose 中配置,但 vite.config.ts 的白名单是硬编码的、从未读取该变量,
换隧道域名必然被 Vite 拦(Blocked request);现已真正接上并默认放行
常见隧道域名后缀。
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
"lint:check": "npm run lint -- --quiet",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"mock:open91": "tsx scripts/mock-open91-order.ts",
|
||||
"douyin-mashida:set-public-url": "tsx scripts/douyin-mashida-set-public-url.ts",
|
||||
"douyin-mashida:preflight": "tsx scripts/douyin-mashida-preflight.ts",
|
||||
"test": "node --import tsx --test $(find src \\( -name '*.test.ts' -o -name '*.test.js' \\) -print)",
|
||||
"test:industry": "tsx scripts/test-kuaishou-industry.ts",
|
||||
"test:industry:http": "tsx scripts/test-kuaishou-industry-http.ts",
|
||||
|
||||
Reference in New Issue
Block a user