From 9074766285d623c9a9324e76e6d2fcdfe3d9dcb3 Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 10 Jun 2022 10:48:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E5=A4=87=E4=BB=BD=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=96=B9=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/table/settings/backupsTable.vue | 5 +++-- nezha-fronted/src/components/page/config/backups.vue | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/common/table/settings/backupsTable.vue b/nezha-fronted/src/components/common/table/settings/backupsTable.vue index 9569faa04..81cdcdb82 100644 --- a/nezha-fronted/src/components/common/table/settings/backupsTable.vue +++ b/nezha-fronted/src/components/common/table/settings/backupsTable.vue @@ -146,8 +146,8 @@ export default { }) }, changeDate (item) { - const time = Date.parse(item) - const time1 = this.timeFormate(time) + const time = this.utcTimeToTimezoneStr(item) + const time1 = this.timeFormate(Date.parse(time)) return time1 }, getNum (item) { @@ -157,6 +157,7 @@ export default { post('/sys/backup').then((res) => { if (res.code == 200) { this.$message.success(this.$t('backup.backupNow')) + bus.$emit('backupNow') } else { this.$message.error(res.msg) } diff --git a/nezha-fronted/src/components/page/config/backups.vue b/nezha-fronted/src/components/page/config/backups.vue index a8c127dec..13e9ef43b 100644 --- a/nezha-fronted/src/components/page/config/backups.vue +++ b/nezha-fronted/src/components/page/config/backups.vue @@ -59,6 +59,7 @@ import nzDataList from '@/components/common/table/nzDataList' import backupsTable from '@/components/common/table/settings/backupsTable' import backupsBox from '@/components/common/rightBox/administration/backupsBox' +import bus from '@/libs/bus' export default { name: 'backups', @@ -106,6 +107,9 @@ export default { mounted () { this.getTableData() + bus.$on('backupNow', () => { + this.getTableData() + }) }, methods: { @@ -123,7 +127,7 @@ export default { } } }) - this.$post('/sys/backup/list').then((res) => { + this.$get('/sys/backup/list').then((res) => { if (res.code === 200) { if (res.data) { this.tableData2 = res.data @@ -143,7 +147,7 @@ export default { } }) - this.$post('/sys/backup/list').then((res) => { + this.$get('/sys/backup/list').then((res) => { if (res.code === 200) { if (res.data) { this.tableData2 = res.data @@ -151,7 +155,7 @@ export default { } }) } else if (item == 'recent') { - this.$post('/sys/backup/list').then((res) => { + this.$get('/sys/backup/list').then((res) => { if (res.code === 200) { if (res.data) { this.tableData2 = res.data