fix: 修复许可证失效主题切换错误问题 (#7075)

This commit is contained in:
2024-11-15 15:24:01 +08:00 committed by GitHub
parent 3a400dd15a
commit eea4cf68ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -90,6 +90,7 @@ const submit = async () => {
globalStore.isProductPro = true; globalStore.isProductPro = true;
const xpackRes = await getXpackSetting(); const xpackRes = await getXpackSetting();
if (xpackRes) { if (xpackRes) {
globalStore.themeConfig.theme = xpackRes.data.theme;
globalStore.themeConfig.themeColor = xpackRes.data.themeColor; globalStore.themeConfig.themeColor = xpackRes.data.themeColor;
} }
loading.value = false; loading.value = false;

View File

@ -300,14 +300,14 @@ const search = async () => {
if (isProductPro.value) { if (isProductPro.value) {
const xpackRes = await getXpackSetting(); const xpackRes = await getXpackSetting();
if (xpackRes) { if (xpackRes) {
form.theme = xpackRes.data.theme || globalStore.themeConfig.theme; form.theme = xpackRes.data.theme || globalStore.themeConfig.theme || 'light';
form.themeColor = JSON.parse(xpackRes.data.themeColor); form.themeColor = JSON.parse(xpackRes.data.themeColor);
globalStore.themeConfig.themeColor = xpackRes.data.themeColor; globalStore.themeConfig.themeColor = xpackRes.data.themeColor;
globalStore.themeConfig.theme = form.theme; globalStore.themeConfig.theme = form.theme;
form.proxyDocker = xpackRes.data.proxyDocker; form.proxyDocker = xpackRes.data.proxyDocker;
} }
} else { } else {
form.theme = res.data.theme; form.theme = globalStore.themeConfig.theme || res.data.theme || 'light';
} }
}; };
@ -395,10 +395,6 @@ const onSave = async (key: string, val: any) => {
} }
globalStore.themeConfig.primary = color; globalStore.themeConfig.primary = color;
setPrimaryColor(color); setPrimaryColor(color);
MsgSuccess(i18n.t('commons.msg.operationSuccess'));
loading.value = false;
await search();
return;
} }
} }
if (key === 'MenuTabs') { if (key === 'MenuTabs') {