feat 页面标题和页面的favicon.ico动态修复

This commit is contained in:
Ironsp
2026-07-07 09:23:30 +08:00
parent 88186b8dfc
commit 93a5feabdc
5 changed files with 48 additions and 23 deletions

View File

@@ -30,6 +30,8 @@ import './permission';
// 国际化
import i18n from '@/lang/index';
import { useSettingsStore } from '@/store/modules/settings';
import { getDemo } from '@/api/systemList/index';
// vxeTable
import VXETable from 'vxe-table';
@@ -54,4 +56,24 @@ app.use(plugins);
// 自定义指令
directive(app);
const settingsStore = useSettingsStore();
getDemo()
.then((res) => {
const name = res?.data?.name;
const url = res?.data?.url;
if (name || url) {
settingsStore.setSystemInfo(name || '', url || '');
if (url) {
const link = document.querySelector("link[rel='icon']") as HTMLLinkElement | null;
if (link) {
link.href = url;
}
}
}
})
.catch(() => {
// ignore
});
app.mount('#app');