fix(all): 累积的错误修复和细节修正
This commit is contained in:
@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app_: FastAPI) -> AsyncGenerator[None, Any]:
|
||||
async def lifespan(_: FastAPI) -> AsyncGenerator[None, Any]:
|
||||
# 在生命周期函数内先加载环境变量,再局部导入 nyahome 核心模块
|
||||
logger.info("🚀 服务启动中...")
|
||||
|
||||
@@ -50,6 +50,7 @@ app.include_router(aii_router, prefix="/api")
|
||||
app.mount("/nyahome", StaticFiles(directory=Path.cwd() / "public"), name="public")
|
||||
app.mount("/download", StaticFiles(directory=Path.cwd() / ".nyahome/contents"), name="upload")
|
||||
|
||||
# noinspection PyTypeChecker
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
|
||||
Reference in New Issue
Block a user