mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +08:00
@@ -45,9 +45,15 @@ async def lifespan(app: FastAPI):
|
||||
yield
|
||||
|
||||
app = create_app(lifespan=lifespan)
|
||||
origins = [
|
||||
"http://localhost",
|
||||
"http://127.0.0.1",
|
||||
"http://tauri.localhost",
|
||||
]
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["tauri://localhost"], # 加上 Tauri 的 origin
|
||||
allow_origins=origins, # 加上 Tauri 的 origin
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
Reference in New Issue
Block a user