Skip to content

Commit 82919f1

Browse files
committed
修复备份设置页面TypeScript类型错误
1 parent 3aaaa6a commit 82919f1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/views/system/BackupSettings.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</template>
9999

100100
<script setup lang="ts">
101-
import { ref, onMounted, computed } from 'vue'
101+
import { ref, onMounted } from 'vue'
102102
import { message } from 'ant-design-vue'
103103
import dayjs, { Dayjs } from 'dayjs'
104104
import { getBackupConfig, saveBackupConfig, triggerBackup, type BackupConfigRequest } from '@/api/system'
@@ -119,7 +119,11 @@ const backupTime = ref<Dayjs | null>(null)
119119
const updateBackupTime = () => {
120120
if (backupConfig.value.backup_time) {
121121
const [hour, minute] = backupConfig.value.backup_time.split(':')
122-
backupTime.value = dayjs().hour(parseInt(hour)).minute(parseInt(minute)).second(0).millisecond(0)
122+
if (hour && minute) {
123+
backupTime.value = dayjs().hour(parseInt(hour)).minute(parseInt(minute)).second(0).millisecond(0)
124+
} else {
125+
backupTime.value = dayjs().hour(2).minute(0).second(0).millisecond(0)
126+
}
123127
} else {
124128
backupTime.value = dayjs().hour(2).minute(0).second(0).millisecond(0)
125129
}

0 commit comments

Comments
 (0)