🐛 修复webui下载后首次启动错误 (#1652)

* 🐛 修复webui下载后首次启动错误

* chore(version): Update version to v0.2.2-4a8ef85

---------

Co-authored-by: HibiKier <HibiKier@users.noreply.github.com>
This commit is contained in:
HibiKier 2024-09-25 19:41:45 +08:00 committed by GitHub
parent e89d1d4688
commit 7ec1bc9fac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -1 +1 @@
__version__: v0.2.2-d539b1f
__version__: v0.2.2-4a8ef85

View File

@ -20,6 +20,11 @@ async def favicon():
return FileResponse(PUBLIC_PATH / "favicon.ico")
@router.get("/79edfa81f3308a9f.jfif")
async def _():
return FileResponse(PUBLIC_PATH / "79edfa81f3308a9f.jfif")
async def init_public(app: FastAPI):
try:
if not PUBLIC_PATH.exists():

View File

@ -40,4 +40,4 @@ def _file_handle(webui_assets_path: Path):
shutil.copytree(download_file_path / "dist", PUBLIC_PATH, dirs_exist_ok=True)
logger.debug("复制 webui_assets 成功...", COMMAND_NAME)
shutil.rmtree(TMP_PATH, ignore_errors=True)
return [x.name for x in PUBLIC_PATH.iterdir()]
return [x.name for x in PUBLIC_PATH.iterdir() if x.is_dir()]