mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 修改 xpack 依赖 (#4414)
This commit is contained in:
parent
646fc4e678
commit
494da3c209
@ -23,7 +23,6 @@ import { DeviceType } from '@/enums/app';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useTheme } from '@/hooks/use-theme';
|
||||
import { getLicense, getSettingInfo, getSystemAvailable } from '@/api/modules/setting';
|
||||
import { searchXSetting } from '@/xpack/api/modules/setting';
|
||||
useResize();
|
||||
|
||||
const menuStore = MenuStore();
|
||||
@ -74,15 +73,31 @@ const loadDataFromDB = async () => {
|
||||
};
|
||||
|
||||
const loadDataFromXDB = async () => {
|
||||
const res = await searchXSetting();
|
||||
globalStore.themeConfig.title = res.data.title;
|
||||
globalStore.themeConfig.logo = res.data.logo;
|
||||
globalStore.themeConfig.logoWithText = res.data.logoWithText;
|
||||
globalStore.themeConfig.favicon = res.data.favicon;
|
||||
|
||||
const xpackModules = import.meta.globEager('../xpack/api/modules/*.ts');
|
||||
if (xpackModules['../xpack/api/modules/setting.ts']) {
|
||||
const searchXSetting = xpackModules['../xpack/api/modules/setting.ts'].searchXSetting;
|
||||
if (searchXSetting) {
|
||||
const res = await searchXSetting();
|
||||
globalStore.themeConfig.title = res.data.title;
|
||||
globalStore.themeConfig.logo = res.data.logo;
|
||||
globalStore.themeConfig.logoWithText = res.data.logoWithText;
|
||||
globalStore.themeConfig.favicon = res.data.favicon;
|
||||
} else {
|
||||
resetSetting();
|
||||
}
|
||||
} else {
|
||||
resetSetting();
|
||||
}
|
||||
initFavicon();
|
||||
};
|
||||
|
||||
const resetSetting = () => {
|
||||
globalStore.themeConfig.title = '';
|
||||
globalStore.themeConfig.logo = '';
|
||||
globalStore.themeConfig.logoWithText = '';
|
||||
globalStore.themeConfig.favicon = '';
|
||||
};
|
||||
|
||||
const loadProductProFromDB = async () => {
|
||||
const res = await getLicense();
|
||||
globalStore.isProductPro =
|
||||
|
Loading…
x
Reference in New Issue
Block a user