mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 06:12:53 +08:00
🐛 修复路径解压与挂载 (#1619)
This commit is contained in:
parent
4e42d1dda1
commit
95762bdddd
@ -25,7 +25,7 @@ async def init_public(app: FastAPI):
|
||||
if not PUBLIC_PATH.exists():
|
||||
folders = await update_webui_assets()
|
||||
else:
|
||||
folders = [x.name for x in PUBLIC_PATH.iterdir()]
|
||||
folders = [x.name for x in PUBLIC_PATH.iterdir() if x.is_dir()]
|
||||
app.include_router(router)
|
||||
for pathname in folders:
|
||||
logger.debug(f"挂载文件夹: {pathname}")
|
||||
|
||||
@ -35,7 +35,7 @@ def _file_handle(webui_assets_path: Path):
|
||||
logger.debug("解压 webui_assets 成功...", COMMAND_NAME)
|
||||
else:
|
||||
raise Exception("解压 webui_assets 失败,文件不存在...", COMMAND_NAME)
|
||||
download_file_path = TMP_PATH / next(iter(TMP_PATH.iterdir()))
|
||||
download_file_path = next(f for f in TMP_PATH.iterdir() if f.is_dir())
|
||||
shutil.rmtree(PUBLIC_PATH, ignore_errors=True)
|
||||
shutil.copytree(download_file_path / "dist", PUBLIC_PATH, dirs_exist_ok=True)
|
||||
logger.debug("复制 webui_assets 成功...", COMMAND_NAME)
|
||||
|
||||
@ -441,7 +441,7 @@ class ConfigsManager:
|
||||
self._data[module] = config_group
|
||||
logger.info(
|
||||
f"加载配置完成,共加载 <u><y>{len(temp_data)}</y></u> 个配置组及对应"
|
||||
" <u><y>{count}</y></u> 个配置项"
|
||||
f" <u><y>{count}</y></u> 个配置项"
|
||||
)
|
||||
|
||||
def get_data(self) -> dict[str, ConfigGroup]:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user