From f40b053e5b3f0ebac26fae2fde51b3c11938e898 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:35:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=88=A0=E9=99=A4=E6=97=B6=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=80=89=E4=B8=AD=E5=80=BC=20(#1616)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/cronjob_helper.go | 2 ++ frontend/src/views/cronjob/record/index.vue | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/backend/app/service/cronjob_helper.go b/backend/app/service/cronjob_helper.go index 44b43435a..d91416456 100644 --- a/backend/app/service/cronjob_helper.go +++ b/backend/app/service/cronjob_helper.go @@ -186,6 +186,8 @@ func (u *CronjobService) HandleRmExpired(backType, backupPath, localDir string, itemPath := strings.TrimPrefix(backupPath, "/") itemPath = strings.TrimSuffix(itemPath, "/") + "/" fileItem = itemPath + strings.TrimPrefix(file, localDir+"/") + } else { + fileItem = strings.TrimPrefix(file, localDir+"/") } } _, _ = backClient.Delete(fileItem) diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index fc473f14e..2c9732e2b 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -528,12 +528,17 @@ const search = async () => { if (!currentRecord.value) { currentRecord.value = records.value[0]; } else { + let beDelete = true; for (const item of records.value) { if (item.id === currentRecord.value.id) { + beDelete = false; currentRecord.value = item; break; } } + if (beDelete) { + currentRecord.value = records.value[0]; + } } if (currentRecord.value?.records) { loadRecord(currentRecord.value);