- 后端: FastAPI + SQLAlchemy + SQLite, JWT认证, 代理支持的AirwallexClient - 前端: React 18 + Vite + Ant Design 5, 中文界面 - 功能: 卡片管理, 持卡人管理, 交易记录, API令牌, 系统设置, 审计日志 - 第三方API: X-API-Key认证, 权限控制 - Docker部署: docker-compose编排前后端
39 lines
945 B
Python
39 lines
945 B
Python
"""Application configuration using pydantic-settings."""
|
|
import secrets
|
|
from typing import Optional
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables and .env file."""
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
case_sensitive=False,
|
|
)
|
|
|
|
# Admin credentials
|
|
ADMIN_USERNAME: str = "admin"
|
|
ADMIN_PASSWORD: str = "admin123"
|
|
|
|
# JWT settings
|
|
SECRET_KEY: str = secrets.token_urlsafe(32)
|
|
JWT_ALGORITHM: str = "HS256"
|
|
JWT_EXPIRE_MINUTES: int = 480
|
|
|
|
# Database
|
|
DATABASE_URL: str = "sqlite:///./data/airwallex.db"
|
|
|
|
# Airwallex API
|
|
AIRWALLEX_CLIENT_ID: str = ""
|
|
AIRWALLEX_API_KEY: str = ""
|
|
AIRWALLEX_BASE_URL: str = "https://api.airwallex.com/"
|
|
|
|
# Proxy (optional)
|
|
PROXY_URL: Optional[str] = None
|
|
|
|
|
|
settings = Settings()
|