mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 06:12:53 +08:00
🐛 修复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:
parent
e89d1d4688
commit
7ec1bc9fac
@ -1 +1 @@
|
|||||||
__version__: v0.2.2-d539b1f
|
__version__: v0.2.2-4a8ef85
|
||||||
|
|||||||
@ -20,6 +20,11 @@ async def favicon():
|
|||||||
return FileResponse(PUBLIC_PATH / "favicon.ico")
|
return FileResponse(PUBLIC_PATH / "favicon.ico")
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/79edfa81f3308a9f.jfif")
|
||||||
|
async def _():
|
||||||
|
return FileResponse(PUBLIC_PATH / "79edfa81f3308a9f.jfif")
|
||||||
|
|
||||||
|
|
||||||
async def init_public(app: FastAPI):
|
async def init_public(app: FastAPI):
|
||||||
try:
|
try:
|
||||||
if not PUBLIC_PATH.exists():
|
if not PUBLIC_PATH.exists():
|
||||||
|
|||||||
@ -40,4 +40,4 @@ def _file_handle(webui_assets_path: Path):
|
|||||||
shutil.copytree(download_file_path / "dist", PUBLIC_PATH, dirs_exist_ok=True)
|
shutil.copytree(download_file_path / "dist", PUBLIC_PATH, dirs_exist_ok=True)
|
||||||
logger.debug("复制 webui_assets 成功...", COMMAND_NAME)
|
logger.debug("复制 webui_assets 成功...", COMMAND_NAME)
|
||||||
shutil.rmtree(TMP_PATH, ignore_errors=True)
|
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()]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user