diff --git a/frontend/src/components/system-upgrade/index.vue b/frontend/src/components/system-upgrade/index.vue index b94636498..c791baf78 100644 --- a/frontend/src/components/system-upgrade/index.vue +++ b/frontend/src/components/system-upgrade/index.vue @@ -134,6 +134,7 @@ const onUpgrade = async () => { }).then(async () => { globalStore.isLoading = true; await upgrade(upgradeVersion.value); + globalStore.isOnRestart = true; drawerVisible.value = false; MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); search(); diff --git a/frontend/src/store/index.ts b/frontend/src/store/index.ts index 24c8a2a4b..423ae77ed 100644 --- a/frontend/src/store/index.ts +++ b/frontend/src/store/index.ts @@ -22,6 +22,7 @@ export const GlobalStore = defineStore({ footer: true, }, isFullScreen: false, + isOnRestart: false, agreeLicense: false, hasNewVersion: false, ignoreCaptcha: true, diff --git a/frontend/src/store/interface/index.ts b/frontend/src/store/interface/index.ts index b673c643b..141a60814 100644 --- a/frontend/src/store/interface/index.ts +++ b/frontend/src/store/interface/index.ts @@ -17,6 +17,7 @@ export interface GlobalState { // assemblySize: string; // small | default | large themeConfig: ThemeConfigProp; isFullScreen: boolean; + isOnRestart: boolean; agreeLicense: boolean; hasNewVersion: boolean; ignoreCaptcha: boolean; diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 3cf621039..976e8b3bb 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -381,7 +381,7 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => { appRef.value.acceptParams(); if (isInit) { timer = setInterval(async () => { - if (isActive.value) { + if (isActive.value && !globalStore.isOnRestart) { await onLoadCurrentInfo(); } }, 3000); @@ -550,6 +550,7 @@ const restart = async (type: string) => { type: 'info', }, ).then(async () => { + globalStore.isOnRestart = true; MsgSuccess(i18n.global.t('home.operationSuccess')); await systemRestart(type); }); diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 71d849172..589253f56 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -315,6 +315,7 @@ const loadLanguage = async () => { }; onMounted(() => { + globalStore.isOnRestart = false; loginVerify(); loadLanguage(); document.title = globalStore.themeConfig.panelName; diff --git a/frontend/src/views/login/entrance/index.vue b/frontend/src/views/login/entrance/index.vue index 687f22ef4..ea22c076c 100644 --- a/frontend/src/views/login/entrance/index.vue +++ b/frontend/src/views/login/entrance/index.vue @@ -82,6 +82,7 @@ const getStatus = async () => { }; onMounted(() => { + globalStore.isOnRestart = false; getStatus(); screenWidth.value = document.body.clientWidth; window.onresize = () => {