修复跨域问题
This commit is contained in:
@@ -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
|
||||
|
||||
# 公开路径跳过认证
|
||||
|
||||
Reference in New Issue
Block a user