Files
soul/DEPLOYMENT.md
v0 f3195d9331 refactor: overhaul homepage and app structure
Simplify homepage, show chapter counts, display directory, trim bottom nav, in-page match feature, move marketing content, and enhance "My" page.

#VERCEL_SKIP

Co-authored-by: undefined <undefined+undefined@users.noreply.github.com>
2026-01-14 05:10:32 +00:00

91 lines
2.1 KiB
Markdown
Raw 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. Vercel部署
\`\`\`bash
# 安装Vercel CLI
npm install -g vercel
# 登录Vercel
vercel login
# 部署项目
vercel --prod
\`\`\`
### 2. 环境变量配置
在Vercel项目设置中添加以下环境变量
**支付宝配置:**
- `ALIPAY_PARTNER_ID`: 2088511801157159
- `ALIPAY_KEY`: lz6ey1h3kl9zqkgtjz3avb5gk37wzbrp
- `ALIPAY_APP_ID`: wx432c93e275548671
- `ALIPAY_RETURN_URL`: https://your-domain.com/payment/success
- `ALIPAY_NOTIFY_URL`: https://your-domain.com/api/payment/alipay/notify
**微信支付配置:**
- `WECHAT_APP_ID`: wx432c93e275548671
- `WECHAT_APP_SECRET`: 25b7e7fdb7998e5107e242ebb6ddabd0
- `WECHAT_MCH_ID`: 1318592501
- `WECHAT_API_KEY`: wx3e31b068be59ddc131b068be59ddc2
- `WECHAT_NOTIFY_URL`: https://your-domain.com/api/payment/wechat/notify
**基础配置:**
- `NEXT_PUBLIC_BASE_URL`: https://your-domain.com
### 3. 域名配置
1. 在Vercel项目设置中绑定自定义域名
2. 配置DNS记录指向Vercel
3. 启用HTTPSVercel自动配置SSL证书
### 4. 支付回调配置
**支付宝配置:**
1. 登录支付宝开放平台
2. 在应用详情中配置异步通知地址:`https://your-domain.com/api/payment/alipay/notify`
3. 配置同步返回地址:`https://your-domain.com/payment/success`
**微信支付配置:**
1. 登录微信商户平台
2. 在产品中心配置支付回调URL`https://your-domain.com/api/payment/wechat/notify`
3. 添加支付授权域名:`your-domain.com`
### 5. 测试流程
1. 创建测试订单
2. 使用沙箱环境测试支付宝支付
3. 使用微信开发者工具测试微信支付
4. 验证回调接口正常接收
5. 确认订单状态更新正确
6. 验证内容解锁功能
### 6. 监控和日志
- 在Vercel Dashboard查看部署日志
- 使用Vercel Analytics监控访问数据
- 配置错误告警通知
## 本地开发
\`\`\`bash
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 访问 http://localhost:3000
\`\`\`
## 注意事项
1. 生产环境必须使用HTTPS
2. 定期更新支付密钥
3. 保护环境变量安全
4. 备份用户数据
5. 监控支付异常