Merge pull request '修复后台登录进入后,刷新网站图标未正常加载的问题。' (#321) from TowCents/Admin.NET.Pro:v2 into v2

Reviewed-on: https://code.adminnet.top/Admin.NET/Admin.NET.Pro/pulls/321
This commit is contained in:
zuohuaijun 2025-04-25 22:53:11 +08:00
commit 6df37f0659
2 changed files with 88 additions and 82 deletions

View File

@ -22,7 +22,7 @@ import mittBus from '/@/utils/mitt';
import setIntroduction from '/@/utils/setIconfont'; import setIntroduction from '/@/utils/setIconfont';
// import Watermark from '/@/utils/watermark'; // import Watermark from '/@/utils/watermark';
import { initIdleTimeout } from '/@/utils/idleTimeout'; import { initIdleTimeout } from '/@/utils/idleTimeout';
import { updateFavicon } from '/@/utils/sysInfo'
// //
const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue')); const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue'));
const Settings = defineAsyncComponent(() => import('/@/layout/navBars/topBar/settings.vue')); const Settings = defineAsyncComponent(() => import('/@/layout/navBars/topBar/settings.vue'));
@ -74,6 +74,12 @@ onMounted(() => {
if (Local.get('themeConfig')) { if (Local.get('themeConfig')) {
storesThemeConfig.setThemeConfig({ themeConfig: Local.get('themeConfig') }); storesThemeConfig.setThemeConfig({ themeConfig: Local.get('themeConfig') });
document.documentElement.style.cssText = Local.get('themeConfigStyle'); document.documentElement.style.cssText = Local.get('themeConfigStyle');
// favicon
const storedConfig = Local.get('themeConfig');
if (storedConfig && storedConfig.logoUrl) {
updateFavicon(storedConfig.logoUrl);
}
} }
// //
if (Session.get('isTagsViewCurrenFull')) { if (Session.get('isTagsViewCurrenFull')) {

View File

@ -75,7 +75,7 @@ export async function loadSysInfo(tenantid: number) {
} }
// 更新 favicon // 更新 favicon
const updateFavicon = (url: string): void => { export const updateFavicon = (url: string): void => {
const favicon = document.getElementById('favicon') as HTMLAnchorElement; const favicon = document.getElementById('favicon') as HTMLAnchorElement;
favicon!.href = url ? url : 'data:;base64,='; favicon!.href = url ? url : 'data:;base64,=';
}; };