From 43652b2a540c6dd14bd3e67142789de6b2e7ced2 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Sat, 13 May 2023 15:32:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=B8=8A=E4=BC=A0=E5=A4=87=E4=BB=BD=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#1027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/backup.go | 6 +++--- backend/app/service/database_mysql.go | 3 +++ frontend/src/components/upload/index.vue | 1 + .../src/views/database/redis/setting/persistence/index.vue | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index 5337b7980..c5a2073ff 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -111,9 +111,9 @@ func (u *BackupService) DownloadRecord(info dto.DownloadRecord) (string, error) return "", fmt.Errorf("new cloud storage client failed, err: %v", err) } 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.MkdirAll(path.Base(targetPath), os.ModePerm); err != nil { - global.LOG.Errorf("mkdir %s failed, err: %v", path.Base(targetPath), err) + if _, err := os.Stat(path.Dir(targetPath)); err != nil && os.IsNotExist(err) { + if err = os.MkdirAll(path.Dir(targetPath), os.ModePerm); err != nil { + global.LOG.Errorf("mkdir %s failed, err: %v", path.Dir(targetPath), err) } } srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName) diff --git a/backend/app/service/database_mysql.go b/backend/app/service/database_mysql.go index 5803733e0..42308497e 100644 --- a/backend/app/service/database_mysql.go +++ b/backend/app/service/database_mysql.go @@ -257,6 +257,9 @@ func (u *MysqlService) ChangeAccess(info dto.ChangeDBInfo) error { if err != nil { return err } + if info.Value == mysql.Permission { + return nil + } } app, err := appInstallRepo.LoadBaseInfo("mysql", "") if err != nil { diff --git a/frontend/src/components/upload/index.vue b/frontend/src/components/upload/index.vue index 205052370..dd118fd22 100644 --- a/frontend/src/components/upload/index.vue +++ b/frontend/src/components/upload/index.vue @@ -149,6 +149,7 @@ const search = async () => { const onRecover = async (row: File.File) => { let params = { + source: 'LOCAL', type: type.value, name: name.value, detailName: detailName.value, diff --git a/frontend/src/views/database/redis/setting/persistence/index.vue b/frontend/src/views/database/redis/setting/persistence/index.vue index e643782fc..eada5934a 100644 --- a/frontend/src/views/database/redis/setting/persistence/index.vue +++ b/frontend/src/views/database/redis/setting/persistence/index.vue @@ -201,6 +201,7 @@ const onBackup = async () => { }; const onRecover = async () => { let param = { + source: currentRow.value.source, type: 'redis', name: '', detailName: '',