fix: Fix the problem of abnormal display of license import (#8506)

This commit is contained in:
ssongliu 2025-04-28 22:45:48 +08:00 committed by GitHub
parent 2bde755fc4
commit e44a56e301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View file

@ -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<UploadInstance>();
@ -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(() => {

View file

@ -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;