From e44a56e3010bbc01b82efabf3c74cacaf7f9fbb2 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:45:48 +0800 Subject: [PATCH] fix: Fix the problem of abnormal display of license import (#8506) --- frontend/src/components/license-import/index.vue | 13 ++++--------- .../components/Sidebar/components/Collapse.vue | 8 ++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/license-import/index.vue b/frontend/src/components/license-import/index.vue index 5207d54bd..85911f9ae 100644 --- a/frontend/src/components/license-import/index.vue +++ b/frontend/src/components/license-import/index.vue @@ -49,11 +49,9 @@ import { MsgSuccess } from '@/utils/message'; import { uploadLicense } from '@/api/modules/setting'; import { GlobalStore } from '@/store'; import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus'; -import { useTheme } from '@/global/use-theme'; -import { getXpackSetting, initFavicon } from '@/utils/xpack'; +import { getXpackSettingForTheme } from '@/utils/xpack'; const globalStore = GlobalStore(); -const { switchTheme } = useTheme(); const loading = ref(false); const open = ref(false); const uploadRef = ref(); @@ -115,18 +113,15 @@ const submit = async () => { await uploadLicense(oldLicense.value, formData) .then(async () => { globalStore.isProductPro = true; - const xpackRes = await getXpackSetting(); - if (xpackRes) { - globalStore.themeConfig.theme = xpackRes.data.theme; - globalStore.themeConfig.themeColor = xpackRes.data.themeColor; + if (globalStore.isMaster) { + globalStore.isMasterProductPro = true; } + getXpackSettingForTheme(); loading.value = false; uploadRef.value!.clearFiles(); uploaderFiles.value = []; open.value = false; MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - switchTheme(); - initFavicon(); window.location.reload(); }) .catch(() => { diff --git a/frontend/src/layout/components/Sidebar/components/Collapse.vue b/frontend/src/layout/components/Sidebar/components/Collapse.vue index b1fbf4082..a2672c359 100644 --- a/frontend/src/layout/components/Sidebar/components/Collapse.vue +++ b/frontend/src/layout/components/Sidebar/components/Collapse.vue @@ -83,6 +83,7 @@ import { countExecutingTask } from '@/api/modules/log'; import { MsgError, MsgSuccess } from '@/utils/message'; import i18n from '@/lang'; import { listNodeOptions } from '@/api/modules/setting'; +import { ref, watch } from 'vue'; import bus from '@/global/bus'; import { logOutApi } from '@/api/modules/auth'; import router from '@/routers'; @@ -99,6 +100,12 @@ const props = defineProps({ const isMasterPro = computed(() => { return globalStore.isMasterPro(); }); +watch( + () => globalStore.isMasterPro(), + () => { + loadNodes(); + }, +); const emit = defineEmits(['openTask']); bus.on('refreshTask', () => { @@ -131,6 +138,7 @@ const changeFilter = () => { }; const loadNodes = async () => { + nodes.value = []; if (!isMasterPro.value) { globalStore.currentNode = 'local'; return;