From ce38ae2544d6c247819d394e10124107c69708c6 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:14:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=EF=BC=8C=E6=89=80=E9=80=89=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E4=B8=8B=E6=9C=89=E5=90=8C=E5=90=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=97=B6=E4=BC=9A=E5=9C=A8=E5=90=8C=E5=90=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E4=B8=8B=E5=86=8D=E5=88=9B=E5=BB=BA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6=E5=A4=B9=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#2819)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/files/file_op.go | 3 +++ .../src/views/host/file-management/index.vue | 17 ++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/utils/files/file_op.go b/backend/utils/files/file_op.go index c7c056492..3f95b4ac8 100644 --- a/backend/utils/files/file_op.go +++ b/backend/utils/files/file_op.go @@ -288,6 +288,9 @@ func (f FileOp) Cut(oldPaths []string, dst, name string, cover bool) error { var dstPath string if name != "" { dstPath = filepath.Join(dst, name) + if f.Stat(dstPath) { + dstPath = dst + } } else { base := filepath.Base(p) dstPath = filepath.Join(dst, base) diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index 9761d4396..c81db005a 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -52,7 +52,7 @@