diff --git a/src/api/system/quick-start/bootloader.ts b/src/api/system/quick-start/bootloader.ts index 65372ebe..445fec91 100644 --- a/src/api/system/quick-start/bootloader.ts +++ b/src/api/system/quick-start/bootloader.ts @@ -32,6 +32,7 @@ export function bootloaderReset() { return request({ url: `/bootloader`, method: 'delete', + timeout: 180_000 }); } diff --git a/src/views/system/setting/components/system-reset.vue b/src/views/system/setting/components/system-reset.vue index 8b544f69..b395b215 100644 --- a/src/views/system/setting/components/system-reset.vue +++ b/src/views/system/setting/components/system-reset.vue @@ -10,14 +10,12 @@ const { t } = useI18n(); type StateType = { visible: boolean; - confirmLoading: boolean; count: number; timer: any; }; let state: StateType = reactive({ visible: false, - confirmLoading: false, count: 10, timer: null, }); @@ -38,23 +36,18 @@ function fnModalVisible() { /**对话框提交确认 */ function fnModalOk() { // 发送请求 - const hide = message.loading(t('common.loading'), 0); - state.confirmLoading = true; - bootloaderReset() - .then(res => { - state.confirmLoading = false; - if (res.code === RESULT_CODE_SUCCESS) { - fnModalCancel(); - lockedStore.fnLock('reload'); - } else { - message.error(res.msg, 3); - clearInterval(state.timer); - state.timer = null; - } - }) - .finally(() => { - hide(); - }); + lockedStore.fnLock('reset'); + bootloaderReset().then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + fnModalCancel(); + lockedStore.fnLock('reload'); + } else { + lockedStore.fnLock('none'); + message.error(res.msg, 3); + clearInterval(state.timer); + state.timer = null; + } + }); } /**对话框取消操作 */ @@ -80,7 +73,7 @@ function fnModalCancel() { :ok-text=" state.count > 0 ? `${t('common.ok')} ${state.count}` : t('common.ok') " - :confirmLoading="state.count > 0 || state.confirmLoading" + :confirmLoading="state.count > 0" @ok="fnModalOk()" @cancel="fnModalCancel()" >