mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
feat(wallet): 钱包系统替代配额系统,新增支付与退款机制
- 新增钱包余额管理、充值、扣费、退款完整流程 - 新增支付网关抽象层(支持手动/支付宝/微信) - 用量计费从配额系统迁移到钱包余额扣费 - 新增管理员钱包管理与支付订单管理页面 - 新增用户钱包中心页面 - 移除独立 Key 锁定机制,统一由钱包余额控制 - 新增相关 API 路由、序列化器与数据库迁移 - 新增钱包、支付、退款相关测试
This commit is contained in:
@@ -103,6 +103,9 @@ class Config:
|
||||
# API Key 配置
|
||||
self.api_key_prefix = os.getenv("API_KEY_PREFIX", "sk")
|
||||
|
||||
# 支付回调安全配置(公开回调入口必须携带该共享密钥)
|
||||
self.payment_callback_secret = os.getenv("PAYMENT_CALLBACK_SECRET", "").strip()
|
||||
|
||||
# LLM API 速率限制配置(每分钟请求数)
|
||||
self.llm_api_rate_limit = int(os.getenv("LLM_API_RATE_LIMIT", "100"))
|
||||
self.public_api_rate_limit = int(os.getenv("PUBLIC_API_RATE_LIMIT", "60"))
|
||||
@@ -458,6 +461,11 @@ class Config:
|
||||
# CORS 配置警告(生产环境)
|
||||
if self.environment == "production" and not self.cors_origins:
|
||||
logger.warning("生产环境 CORS 未配置,前端将无法访问 API。请设置 CORS_ORIGINS。")
|
||||
if self.environment == "production" and not self.payment_callback_secret:
|
||||
logger.warning(
|
||||
"生产环境未设置 PAYMENT_CALLBACK_SECRET,支付回调将被拒绝。"
|
||||
"如需启用支付回调,请配置共享密钥。"
|
||||
)
|
||||
|
||||
def validate_security_config(self) -> list[str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user