fix: 解决数据库上传备份恢复失败的问题 (#1027)

This commit is contained in:
ssongliu 2023-05-13 15:32:28 +08:00 committed by GitHub
parent 574a504ec3
commit 43652b2a54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -111,9 +111,9 @@ func (u *BackupService) DownloadRecord(info dto.DownloadRecord) (string, error)
return "", fmt.Errorf("new cloud storage client failed, err: %v", err) return "", fmt.Errorf("new cloud storage client failed, err: %v", err)
} }
targetPath := fmt.Sprintf("%s/download/%s/%s", constant.DataDir, info.FileDir, info.FileName) targetPath := fmt.Sprintf("%s/download/%s/%s", constant.DataDir, info.FileDir, info.FileName)
if _, err := os.Stat(path.Base(targetPath)); err != nil && os.IsNotExist(err) { if _, err := os.Stat(path.Dir(targetPath)); err != nil && os.IsNotExist(err) {
if err = os.MkdirAll(path.Base(targetPath), os.ModePerm); err != nil { if err = os.MkdirAll(path.Dir(targetPath), os.ModePerm); err != nil {
global.LOG.Errorf("mkdir %s failed, err: %v", path.Base(targetPath), err) global.LOG.Errorf("mkdir %s failed, err: %v", path.Dir(targetPath), err)
} }
} }
srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName) srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName)

View File

@ -257,6 +257,9 @@ func (u *MysqlService) ChangeAccess(info dto.ChangeDBInfo) error {
if err != nil { if err != nil {
return err return err
} }
if info.Value == mysql.Permission {
return nil
}
} }
app, err := appInstallRepo.LoadBaseInfo("mysql", "") app, err := appInstallRepo.LoadBaseInfo("mysql", "")
if err != nil { if err != nil {

View File

@ -149,6 +149,7 @@ const search = async () => {
const onRecover = async (row: File.File) => { const onRecover = async (row: File.File) => {
let params = { let params = {
source: 'LOCAL',
type: type.value, type: type.value,
name: name.value, name: name.value,
detailName: detailName.value, detailName: detailName.value,

View File

@ -201,6 +201,7 @@ const onBackup = async () => {
}; };
const onRecover = async () => { const onRecover = async () => {
let param = { let param = {
source: currentRow.value.source,
type: 'redis', type: 'redis',
name: '', name: '',
detailName: '', detailName: '',