feat: 不对options请求做token认证

This commit is contained in:
martsforever
2025-08-22 15:19:49 +08:00
parent 77162e1f0a
commit cab24a2630
+1 -1
View File
@@ -31,7 +31,7 @@ def add_app_middlewares(app: FastAPI):
@app.middleware("http") @app.middleware("http")
async def add_oauth_middleware(request: Request, call_next): async def add_oauth_middleware(request: Request, call_next):
if not env.jwt_global_enable: if not env.jwt_global_enable or request.method == "OPTIONS":
# 没有开启全局的接口认证功能 # 没有开启全局的接口认证功能
return await call_next(request) return await call_next(request)