feat: 更新验证码请求模型,添加 Google reCAPTCHA 和 Cloudflare Turnstile 验证功能

refactor: 修改用户状态字段类型,优化用户模型
fix: 修复启动服务的错误提示信息
refactor: 统一认证依赖,替换为 AuthRequired
docs: 添加用户会话刷新接口
This commit is contained in:
2025-12-25 10:26:45 +08:00
parent 16cec42181
commit 44a8959aa5
21 changed files with 138 additions and 83 deletions

View File

@@ -1,10 +1,12 @@
from fastapi import FastAPI
from typing import Callable
from contextlib import asynccontextmanager
__on_startup: list[callable] = []
__on_shutdown: list[callable] = []
from fastapi import FastAPI
def add_startup(func: callable):
__on_startup: list[Callable] = []
__on_shutdown: list[Callable] = []
def add_startup(func: Callable):
"""
注册一个函数,在应用启动时调用。
@@ -12,7 +14,7 @@ def add_startup(func: callable):
"""
__on_startup.append(func)
def add_shutdown(func: callable):
def add_shutdown(func: Callable):
"""
注册一个函数,在应用关闭时调用。