修复跨域问题

This commit is contained in:
canglan committed 2026-04-14 12:50:02 +08:00
1 parent bf5b2516e2
commit a29b3f0711
4 files changed
+26 -3

No files matched your search

+4
View File
@@ -49,6 +49,10 @@ class AuthMiddleware(BaseHTTPMiddleware):
"""JWT认证中间件"""
async def dispatch(self, request: Request, call_next):
# OPTIONS 预检请求跳过认证
if request.method == "OPTIONS":
return await call_next(request)
path = request.url.path
# 公开路径跳过认证