From dedfe1e1e1974412a627381f598c4d3d145cae7c Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Sat, 4 Nov 2023 21:46:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E7=AD=89=E6=93=8D=E4=BD=9C=E6=97=B6=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=89=8D=E7=AB=AF=E5=AE=9A=E6=97=B6=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=20(#2801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/system-upgrade/index.vue | 1 + frontend/src/store/index.ts | 1 + frontend/src/store/interface/index.ts | 1 + frontend/src/views/home/index.vue | 3 ++- frontend/src/views/login/components/login-form.vue | 1 + frontend/src/views/login/entrance/index.vue | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) 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 = () => {