Browse Source

fix: 解决备份账号列表下载失败的问题 (#1603)

pull/1604/head
ssongliu 1 year ago committed by GitHub
parent
commit
885e3b60f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      backend/app/service/backup.go

5
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) 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 { if exist, _ := backClient.Exist(srcPath); exist {
isOK, err := backClient.Download(srcPath, targetPath) isOK, err := backClient.Download(srcPath, targetPath)
if !isOK { if !isOK {

Loading…
Cancel
Save