This commit is contained in:
jxxghp 2024-06-20 15:52:52 +08:00
parent 24aa64232f
commit 4af4ad0243

View File

@ -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)