- 后端: 新增 /auth/openid-login 接口(调 CRMEB 补齐用户信息) - 后端: config.py 新增 crmeb_base_url / crmeb_api_key 配置 - 后端: api.ts 新增 openid-login 接口声明 - 前端: LoginPage 改为走 openid-login(openid 单参登录) - 前端: UserContext 修复 avatar_url 未映射导致头像不显示的问题
50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "孕育无忧"
|
|
|
|
# Path Prefix
|
|
api_prefix: str = "/api"
|
|
uploads_prefix: str = "/uploads"
|
|
|
|
# MongoDB
|
|
mongodb_url: str = "mongodb://localhost:27017"
|
|
mongodb_db_name: str = "pregnancy_report"
|
|
|
|
# JWT
|
|
jwt_secret_key: str = "change-this-secret-key"
|
|
jwt_algorithm: str = "HS256"
|
|
jwt_expire_minutes: int = 10080 # 7 days
|
|
|
|
# WeChat
|
|
wechat_app_id: str = ""
|
|
wechat_app_secret: str = ""
|
|
|
|
# AI API (OpenAI 兼容接口,如硅基流动)
|
|
ai_api_key: str = ""
|
|
ai_base_url: str = "https://api.siliconflow.cn/v1"
|
|
ai_vision_model: str = "Qwen/Qwen2.5-VL-72B-Instruct"
|
|
ai_text_model: str = "Qwen/Qwen2.5-72B-Instruct" # 使用更快的72B模型
|
|
|
|
# Upload
|
|
upload_dir: str = "./uploads"
|
|
max_file_size: int = 10 * 1024 * 1024 # 10MB
|
|
|
|
# CORS
|
|
cors_origins: str = "*"
|
|
|
|
# CRMEB internal API
|
|
crmeb_base_url: str = ""
|
|
crmeb_api_key: str = ""
|
|
|
|
# Server
|
|
host: str = "0.0.0.0"
|
|
port: int = 8000
|
|
debug: bool = True
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8", "extra": "ignore"}
|
|
|
|
|
|
settings = Settings()
|