Skip to content

[codex] Route shop users to Sub2API#38

Merged
cnYui merged 1 commit into
mainfrom
codex/sub2api-shop-entry
Jun 17, 2026
Merged

[codex] Route shop users to Sub2API#38
cnYui merged 1 commit into
mainfrom
codex/sub2api-shop-entry

Conversation

@cnYui

@cnYui cnYui commented Jun 17, 2026

Copy link
Copy Markdown
Owner

背景

方案 A 要求公网入口切换为 Sub2API:Sub2API 负责用户 Key、套餐、余额和用量事实源;CLIProxyAPI 退为内网上游账号池;yui.web/shop 只保留展示和跳转入口。

改动

  • 停止 Shop legacy 邀请码兑换和 API key 发放接口,可通过 SHOP_LEGACY_KEY_ISSUANCE_DISABLED=true 返回 410。
  • Shop 首页和指南页改为 Sub2API 入口说明,不再引导朋友直接使用 CLIProxyAPI key。
  • /shop//shop/guide/ 改为公开可访问;账户相关页面继续要求登录。
  • 首页 Sub2API 按钮使用 SUB2API_PUBLIC_URL 服务端配置渲染,避免公网部署时指向访问者本机 localhost。
  • 补充迁移相关回归测试,并更新构建后的 CSS。

验证

  • npm test:198/198 pass
  • npm run build:css:通过
  • git diff --check -- server.js .env.example shop/index.html shop/guide/index.html styles/site.css test/shop-flow.test.js test/shop-frontend.test.js:通过

风险

  • 开启 SHOP_LEGACY_KEY_ISSUANCE_DISABLED=true 后,旧 Shop 发 Key 和邀请码兑换路径会返回 410;这是本次迁移的预期行为。
  • 部署时必须设置正确的 SUB2API_PUBLIC_URL,否则按钮会使用本地开发默认值 http://localhost:18080

@cnYui cnYui force-pushed the codex/sub2api-shop-entry branch from 9cc1740 to f7c0183 Compare June 17, 2026 23:38
@cnYui cnYui merged commit dad8f01 into main Jun 17, 2026
2 checks passed
@cnYui cnYui deleted the codex/sub2api-shop-entry branch June 17, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant