feat: 更新验证码请求模型,添加 Google reCAPTCHA 和 Cloudflare Turnstile 验证功能
refactor: 修改用户状态字段类型,优化用户模型 fix: 修复启动服务的错误提示信息 refactor: 统一认证依赖,替换为 AuthRequired docs: 添加用户会话刷新接口
This commit is contained in:
@@ -7,6 +7,7 @@ oauth2_scheme = OAuth2PasswordBearer(
|
||||
scheme_name='获取 JWT Bearer 令牌',
|
||||
description='用于获取 JWT Bearer 令牌,需要以表单的形式提交',
|
||||
tokenUrl="/api/v1/user/session",
|
||||
refreshUrl="/api/v1/user/session/refresh",
|
||||
)
|
||||
|
||||
SECRET_KEY = ''
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
注册一个函数,在应用关闭时调用。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user