build:完成打包功能

This commit is contained in:
JefferyHcool
2025-06-20 14:45:49 +08:00
parent 50bf467341
commit ef4e67eda6

View File

@@ -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=["*"],