Browse Source

fix: 解决浏览器切换时部分设置未同步的问题 (#5436)

Refs #5422
pull/5440/head
ssongliu 5 months ago committed by GitHub
parent
commit
b6f2497346
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      frontend/src/utils/xpack.ts
  2. 1
      frontend/src/views/login/components/login-form.vue

11
frontend/src/utils/xpack.ts

@ -1,4 +1,4 @@
import { getLicenseStatus } from '@/api/modules/setting';
import { getLicenseStatus, getSettingInfo } from '@/api/modules/setting';
import { useTheme } from '@/hooks/use-theme';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
@ -33,6 +33,14 @@ export async function getXpackSetting() {
return res;
}
const loadDataFromDB = async () => {
const res = await getSettingInfo();
document.title = res.data.panelName;
globalStore.entrance = res.data.securityEntrance;
globalStore.setDefaultNetwork(res.data.defaultNetwork);
globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
};
export async function loadProductProFromDB() {
const res = await getLicenseStatus();
if (!res.data) {
@ -48,6 +56,7 @@ export async function loadProductProFromDB() {
}
switchTheme();
initFavicon();
loadDataFromDB();
}
export async function getXpackSettingForTheme() {

1
frontend/src/views/login/components/login-form.vue

@ -361,6 +361,7 @@ const loadDataFromDB = async () => {
i18n.locale.value = res.data.language;
i18n.warnHtmlMessage = false;
globalStore.entrance = res.data.securityEntrance;
globalStore.setDefaultNetwork(res.data.defaultNetwork);
globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
globalStore.updateLanguage(res.data.language);
globalStore.setThemeConfig({ ...themeConfig.value, theme: res.data.theme, panelName: res.data.panelName });

Loading…
Cancel
Save