Files
邹进 08a7a00cd9
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m25s
fix: 微信授权配置公众号必填、小程序选填
商户池变更把授权完整性实现为公众号与小程序四项凭证都必填,
生产只用公众号 H5、未配置小程序,迁移后授权表为空会导致
C 端微信登录与支付全部失败,后台也无法补建。

- SaveAuthorization 启用时只校验公众号 AppID/AppSecret;
  小程序选填,但 AppID 与 AppSecret 须同时填写或同时留空
- 新增迁移 000240:无授权配置且唯一生效综合配置公众号凭证
  完整时补建启用授权配置;down 不删除数据
- 新增 OpenSpec Change allow-wechat-authorization-without-miniapp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 23:29:55 +09:00

14 lines
997 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. 保存校验
- [x] 1.1 `SaveAuthorization` 启用时只校验公众号 AppID 与 AppSecret 非空;小程序 AppID 与 AppSecret 同时填写或同时留空,否则返回参数错误。
## 2. 迁移
- [x] 2.1 新增成对迁移 `000240_backfill_wechat_authorization_oa_only`:无未删除授权配置、唯一当前生效综合支付配置且公众号凭证完整时补建启用授权配置,小程序字段按原值复制;down 不删除数据。
## 3. 验证
- [x] 3.1 `gofmt`、`go build ./cmd/api ./cmd/worker`、`openspec validate allow-wechat-authorization-without-miniapp`。
- [x] 3.2 在隔离库以显式 `DB_*` 执行 `000240` up/down/up:已有授权配置时无变化;构造“生效配置只有公众号、授权表为空”时补建一条 `status=1`、小程序为空的授权配置。
- [ ] 3.3 测试环境:后台只填公众号保存并启用成功;小程序只填一项被拒;公众号 H5 登录与下单正常;小程序登录返回配置不可用。