允许所有来源
This commit is contained in:
+2
-5
@@ -76,11 +76,8 @@ app.add_middleware(AuditMiddleware)
|
||||
# 确保这是你最后一个添加的 app.add_middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
"http://localhost:3000", # 必须明确指定
|
||||
"http://127.0.0.1:3000", # 建议同时加上这个
|
||||
],
|
||||
allow_credentials=True, # 既然这里是 True
|
||||
allow_origins=["*"], # 允许所有来源
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user