正式环境:爱发电收款全自动(精确反查 + 定时对账 + 买家自查),修复付款区拿不到专链;支付宝预留待开通;维护页开关

Browse Source
- 修线上 bug:付款配置真实键名是 afdian / afdian_uid,后端只认 payplatform* → 页面拿不到专链,
  付款区只显示「付款方式找金钻要」。现在两种键名都认、都返回(含价格档位)。
- 回调反查先按 out_trade_no 精确查,查不到再翻页;去掉「金额唯一匹配」猜单。
- 新增定时对账(每分钟,有待付款单才调接口):回调丢了也自动激活;与回调走同一套处理(账本去重 / 金额闸门 / 激活)。
- 买家点「我已经付好了」先当场对账,付过就直接排队;没付照旧登记待确认。
- 付款信息带 alipay:{on:false, note:待开通},下单页显示灰色「支付宝扫码 · 待开通」,不接任何通道。
- 一起上线 c8f3ae4(进下单页闪黑修复)。
- 新测试《收款对账测试》14 条;回执复现 33、数据库 38、内容后台 86 全过。
- nginx 维护页开关写进部署文档(只拦页面,接口 / 回调 / 同域应用放行)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-10-07 09:25:27 +00:00
co-authored by Claude Opus 5.5
parent c8f3ae4fdb
commit 7c5eec6049
4 changed files with 309 additions and 20 deletions
+21
View File
@@ -165,3 +165,24 @@ location ~ ^/order/api/(payplatform|afdian)-hook$ {
# ⚠️ 每个自己写了 add_header 的 location 里都要再 include 上面两个文件(nginx 不继承 server 级的 add_header) # ⚠️ 每个自己写了 add_header 的 location 里都要再 include 上面两个文件(nginx 不继承 server 级的 add_header)
# nginx.conf 的 http 块:server_tokens off; # nginx.conf 的 http 块:server_tokens off;
``` ```
## ⑥ 维护页开关(2026-10-07 加)
放在 `jinzuan.work` 的 server 块里(两个安全头 include 之后)。**开关不用 reload**:
- 开:`sudo touch /var/www/jinzuan/.maintenance && sudo chown www-data:www-data /var/www/jinzuan/.maintenance`
- 关:`sudo rm -f /var/www/jinzuan/.maintenance`
只拦金钻客栈的页面(返回 503 + `/maintenance.html`);`/order/api/`(爱发电回调、渲染机、内容后台)、同域其它应用、
`/assets/` `/fonts/` 一律放行。带请求头 `X-Jz-Bypass: <BYPASS_SECRET>` 可以绕过维护页验证新页面(密钥只在服务器配置里)。
```nginx
set $jz_maint 0;
if (-f /var/www/jinzuan/.maintenance) { set $jz_maint 1; }
if ($uri ~ "^/(order/api/|api/|ws$|todo|gw|hit$|admin|uploads/|assets/|fonts/|maintenance\.html$|\.well-known/)") { set $jz_maint 0; }
if ($http_x_jz_bypass = "<BYPASS_SECRET>") { set $jz_maint 0; }
if ($jz_maint = 1) { rewrite ^ /__jz_maint last; }
location = /__jz_maint { internal; error_page 503 /maintenance.html; return 503; }
location = /maintenance.html { add_header Cache-Control "no-store" always; add_header Retry-After "900" always;
include snippets/jz-sec-base.conf; include snippets/jz-sec-csp.conf; }
```