87f92987b2
前端: - 集成 in_app_purchase 插件,实现 IAP 支付流程 - 添加支付模块 (payments/) 处理产品获取、购买、验证 - 积分中心页面集成 Apple Pay 购买入口 - 设置页面重构: 关于/隐私/协议直接展示,删除 legal_center 子页面 - 修复欢迎引导页滚动检测阈值问题 - 修复解卦结果页 iOS 侧滑返回手势被阻止的问题 - 邀请码绑定按钮临时禁用(待后端实现) 后端: - 新增 apple_iap_transactions 表记录交易 - 实现 Apple 服务器端验证 (App Store Server API) - 支付成功后自动发放积分 - 支持 Sandbox/Production 环境切换 - 添加退款处理和交易状态机 协议: - 更新积分流水协议,支持 purchase/refund 类型 - 新增 PAYMENT_* 错误码
125 lines
3.2 KiB
Bash
125 lines
3.2 KiB
Bash
# 环境变量配置模板(复制到 .env 并填写实际值)
|
||
# 警告:切勿将包含真实密钥的 .env 提交到代码仓库
|
||
|
||
############
|
||
# 运行时配置
|
||
############
|
||
ERYAO_RUNTIME__ENVIRONMENT=dev
|
||
ERYAO_RUNTIME__DEBUG=true
|
||
ERYAO_RUNTIME__LOG_LEVEL=INFO
|
||
ERYAO_RUNTIME__SQL_LOG_QUERIES=false
|
||
ERYAO_RUNTIME__TRUSTED_PROXY_IPS=[]
|
||
|
||
############
|
||
# Web 服务器配置(Uvicorn)
|
||
############
|
||
ERYAO_WEB__HOST=0.0.0.0
|
||
ERYAO_WEB__PORT=5775
|
||
ERYAO_WEB__WORKERS=2
|
||
|
||
############
|
||
# Redis 配置
|
||
############
|
||
ERYAO_REDIS__PASSWORD=eryao-redis-2026
|
||
ERYAO_REDIS__HOST=localhost
|
||
ERYAO_REDIS__PORT=6379
|
||
ERYAO_REDIS__DB=0
|
||
|
||
############
|
||
# Worker 队列分组配置
|
||
############
|
||
# agent: 常规异步任务
|
||
ERYAO_WORKER__GROUPS__AGENT__CONCURRENCY=2
|
||
|
||
############
|
||
# Supabase 配置
|
||
############
|
||
ERYAO_SUPABASE__PUBLIC_URL=https://your-project.supabase.co
|
||
ERYAO_SUPABASE__ANON_KEY=
|
||
ERYAO_SUPABASE__SERVICE_ROLE_KEY=
|
||
ERYAO_SUPABASE__JWT_SECRET=
|
||
ERYAO_SUPABASE__JWT_ALGORITHM=HS256
|
||
|
||
############
|
||
# PostgreSQL 数据库配置(Supabase 本地开发)
|
||
############
|
||
ERYAO_DATABASE__HOST=localhost
|
||
ERYAO_DATABASE__PORT=5432
|
||
ERYAO_DATABASE__NAME=eryao
|
||
ERYAO_DATABASE__USER=postgres
|
||
ERYAO_DATABASE__PASSWORD=change-me-strong-password
|
||
|
||
############
|
||
# Storage 配置
|
||
############
|
||
ERYAO_STORAGE__ATTACHMENT__BUCKET=agent-attachments
|
||
ERYAO_STORAGE__AVATAR__BUCKET=avatars
|
||
ERYAO_STORAGE__SIGNED_URL_TTL_SECONDS=600
|
||
ERYAO_STORAGE__ATTACHMENT__MAX_SIZE_MB=20
|
||
ERYAO_STORAGE__AVATAR__MAX_SIZE_MB=2
|
||
ERYAO_STORAGE__FEEDBACK__BUCKET=feedback-images
|
||
ERYAO_STORAGE__FEEDBACK__MAX_SIZE_MB=5
|
||
ERYAO_STORAGE__RETENTION_DAYS=30
|
||
|
||
############
|
||
# Feedback Report
|
||
############
|
||
ERYAO_FEEDBACK_REPORT__EMAIL=support@example.com
|
||
ERYAO_FEEDBACK_REPORT__CRON=0 10 * * *
|
||
ERYAO_FEEDBACK_REPORT__ENABLED=false
|
||
|
||
############
|
||
# Email SMTP 配置(飞书企业邮箱)
|
||
############
|
||
ERYAO_EMAIL__HOST=smtp.feishu.cn
|
||
ERYAO_EMAIL__PORT=465
|
||
ERYAO_EMAIL__USERNAME=robot@xunmee.com
|
||
ERYAO_EMAIL__PASSWORD=
|
||
ERYAO_EMAIL__USE_SSL=true
|
||
ERYAO_EMAIL__FROM_ADDRESS=robot@xunmee.com
|
||
ERYAO_EMAIL__FROM_NAME=Eryao 反馈系统
|
||
|
||
############
|
||
# LLM API KEY
|
||
############
|
||
ERYAO_LLM__PROVIDER_KEYS__DASHSCOPE=
|
||
ERYAO_LLM__PROVIDER_KEYS__DEEPSEEK=
|
||
|
||
############
|
||
# Points 策略配置
|
||
############
|
||
ERYAO_POINTS_POLICY__REGISTER_BONUS_POINTS=60
|
||
ERYAO_POINTS_POLICY__REGISTER_BONUS_HMAC_KEY=replace-with-strong-random-key
|
||
|
||
############
|
||
# 敏感词配置
|
||
############
|
||
ERYAO_SENSITIVE_WORD__USE_ALIYUN=true
|
||
ERYAO_SENSITIVE_WORD__FALLBACK_TO_LOCAL=true
|
||
|
||
############
|
||
# CORS 配置
|
||
############
|
||
ERYAO_CORS__ALLOW_ORIGINS=["http://localhost", "http://localhost:3000"]
|
||
|
||
############
|
||
# Test相关
|
||
############
|
||
ERYAO_TEST__EMAIL=test@example.com
|
||
ERYAO_TEST__CODE=123456
|
||
|
||
############
|
||
# Apple IAP 配置
|
||
############
|
||
ERYAO_APPLE_IAP__BUNDLE_ID=com.meeyao.qianwen
|
||
# Server API 密钥(可选,用于主动查询交易状态)
|
||
ERYAO_APPLE_IAP__SERVER_API_KEY_ID=
|
||
ERYAO_APPLE_IAP__SERVER_API_PRIVATE_KEY=
|
||
ERYAO_APPLE_IAP__SERVER_API_ISSUER_ID=
|
||
# 沙盒测试账号(仅用于手动测试,不用于后端验证)
|
||
ERYAO_APPLE_IAP__SANDBOX_TESTER_EMAIL=
|
||
ERYAO_APPLE_IAP__SANDBOX_TESTER_PASSWORD=
|
||
# Server Notifications V2 URL(在 App Store Connect 中配置)
|
||
# 格式: https://<your-domain>/api/v1/payments/apple/notifications
|
||
ERYAO_APPLE_IAP__SERVER_NOTIFICATIONS_URL=
|