fix(all): 累积的错误修复和细节修正

This commit is contained in:
2026-06-01 20:46:58 +08:00
parent 567c146fb8
commit c8c474ecfd
8 changed files with 25 additions and 156 deletions
+2 -1
View File
@@ -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=["*"],