fix(pro): 会员改为「即将开放」,堵住点一下白拿会员的漏洞

原先 /api/pro/activate 直接写库开通一年会员,没有任何支付校验,
任何人调一次接口就是会员。支付暂不接入,这里必须在服务端拒绝,
只改 UI 挡不住直接调接口。

- ActivatePro 一律返回 ErrPayNotReady;真正写库的逻辑保留为
  activateProAfterPaid,等接微信支付时在校验支付单据后调用
- handler 对该错误返回参数错而非 500,前端直接展示提示文案
- 小程序 Pro 弹层按钮置灰为「即将开放」,我的页入口改为
  「Pro 会员(即将开放)」

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-25 18:15:38 +08:00
parent 3fde90e97b
commit 77beb9ca96
5 changed files with 24 additions and 2 deletions
+4
View File
@@ -14,6 +14,10 @@ import (
// ErrNotFound 资源不存在(handler 据此返回 40400
var ErrNotFound = errors.New("not found")
// ErrPayNotReady 支付未接入。会员开通必须走真实支付,未接入前一律拒绝,
// 避免「点一下白拿会员」。
var ErrPayNotReady = errors.New("支付功能即将开放,敬请期待")
// Service 业务逻辑聚合,方法按领域分散在各文件
type Service struct {
db *gorm.DB