feat(server): 接入 QQ 邮箱 SMTP 发送登录验证码
Build and Publish Server / build (push) Successful in 2m6s

- 支持 465 隐式 TLS 与 587 STARTTLS,SMTP 配置优先、Postmark 备用
- 发件人支持 QQ 域名邮箱地址(z@kepo.net),凭证仅走环境变量
- HTTP 测试覆盖发送成功与认证失败;真实发信测试需显式开启 RUN_QQ_SMTP_LIVE_TEST

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
gouki
2026-09-27 23:24:46 +00:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent deb32f8fab
commit c161d42b06
8 changed files with 515 additions and 16 deletions
+5
View File
@@ -2,6 +2,11 @@
## [未发布]
### 邮箱验证码
- 增加 QQ 邮箱 SMTP 登录验证码发送,支持隐式 TLS 与 STARTTLS;SMTP 凭证只从环境变量读取。
- SMTP 配置可用时优先发送,未配置时保留 Postmark 备用通道。
### 排盘记录与免费层
- 每次排盘保存服务端历史记录,后台新增排盘记录页面。
+5 -4
View File
@@ -12,7 +12,7 @@ flowchart TD
B --> C[免费查看四柱、五行、大运、流年、刑冲合害、神煞]
C --> D{是否解锁深度解读}
D -- 否 --> E[继续查看免费排盘]
D -- 是 --> F[Postmark 邮箱验证码登录]
D -- 是 --> F[QQ 邮箱 SMTP 验证码登录]
F --> G{选择支付渠道}
G --> H[Stripe: 4.99 USD]
G --> I[Binance Pay: 5 USDT]
@@ -77,7 +77,7 @@ ZM-ABCD-EFGH-JKLM
### 邮箱登录
- `POST /api/auth/email/request`:通过 Postmark 发送 6 位验证码。
- `POST /api/auth/email/request`:优先通过 QQ SMTP(TLS)发送 6 位验证码;未配置 SMTP 时可使用 Postmark 备用通道。
- `POST /api/auth/email/verify`:验证验证码并签发用户 JWT。
- 验证码 10 分钟有效、最多尝试 5 次、60 秒内不能重复发送。
@@ -133,9 +133,10 @@ Stripe 校验 `Stripe-Signature` 与 5 分钟时间窗口;Binance Pay 使用
前端复制 `.env.example` 为 `.env.local`。只有明确设置 `VITE_PAYMENT_MODE=demo` 才进入演示支付;未设置时默认使用生产支付,避免线上误开模拟解锁。
后端配置见 `server/.env.example`,必须准备:
后端配置见 `server/.env.example`,邮箱登录可配置:
- Postmark Server Token 与已验证发件域名。
- QQ SMTP 主机、端口、完整邮箱地址与 SMTP 授权码;授权码通过环境变量或本地忽略的密钥文件注入,不提交到 Git。
- Postmark Server Token 与已验证发件域名可作为备用通道。
- Stripe Secret Key 与 Webhook Secret。
- Binance Pay 商户 API Key、Secret Key 与 Webhook 公钥。
- 公开 HTTPS API 域名和 Web 地址。