From 6431524e6130194bb8a060620f6c33000e33a186 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 20 Sep 2024 14:01:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20local.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/filemanager/storages/local.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/modules/filemanager/storages/local.py b/app/modules/filemanager/storages/local.py index 9ec55ef6..c9333be5 100644 --- a/app/modules/filemanager/storages/local.py +++ b/app/modules/filemanager/storages/local.py @@ -187,7 +187,11 @@ def upload(self, fileitem: schemas.FileItem, path: Path) -> Optional[schemas.Fil """ 上传文件 """ - file_path = path.rename(fileitem.path) + file_path = Path(fileitem.path) + code, message = SystemUtils.move(path, file_path) + if code != 0: + logger.error(f"移动文件失败:{message}") + return None return self.__get_diritem(file_path) def copy(self, fileitem: schemas.FileItem, target_file: Path) -> bool: