From 4af4ad024304623374551cd2c22b85daad0ddf7d Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 20 Jun 2024 15:52:52 +0800 Subject: [PATCH] fix bug --- app/api/endpoints/local.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/endpoints/local.py b/app/api/endpoints/local.py index f0ff44ae..61de1326 100644 --- a/app/api/endpoints/local.py +++ b/app/api/endpoints/local.py @@ -48,8 +48,10 @@ def list_local(fileitem: schemas.FileItem, else: path = "/" else: - if not SystemUtils.is_windows() and not fileitem.path.startswith("/"): - path = "/" + fileitem.path + if SystemUtils.is_windows(): + path = path.lstrip("/") + elif not path.startswith("/"): + path = "/" + path # 遍历目录 path_obj = Path(path)