From 885e3b60f0310cf664e2b8abdfefca21a3cee78f Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 11 Jul 2023 11:01:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=88=97=E8=A1=A8=E4=B8=8B=E8=BD=BD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#1603)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/backup.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index fc576a442..548c062c2 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -136,6 +136,11 @@ func (u *BackupService) DownloadRecord(info dto.DownloadRecord) (string, error) } } srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName) + if len(backup.BackupPath) != 0 { + itemPath := strings.TrimPrefix(backup.BackupPath, "/") + itemPath = strings.TrimSuffix(itemPath, "/") + "/" + srcPath = itemPath + srcPath + } if exist, _ := backClient.Exist(srcPath); exist { isOK, err := backClient.Download(srcPath, targetPath) if !isOK {