Merge pull request #12825 from dataease/pr@dev-v2@fix_web_icon

fix: 浏览器tab页中网站icon无效
This commit is contained in:
fit2cloud-chenyw
2024-10-22 11:15:17 +08:00
committed by GitHub
2 changed files with 15 additions and 9 deletions

View File

@@ -241,6 +241,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
if (!resData?.length) {
if (!isDataEaseBi) {
document.title = 'DataEase'
setLinkIcon()
}
return
}
@@ -258,6 +259,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
this.showDemoTips = data.showDemoTips
this.demoTipsContent = data.demoTipsContent
this.loaded = true
setLinkIcon()
return
}
this.navigate = data.navigate
@@ -319,18 +321,22 @@ export const useAppearanceStore = defineStore('appearanceStore', {
document.title = 'DataEase'
setTitle('DataEase')
}
const link = document.querySelector('link[rel="icon"]')
if (link) {
if (this.web) {
link['href'] = baseUrl + this.web
} else {
link['href'] = '/dataease.svg'
}
}
setLinkIcon(this.web)
}
}
})
const setLinkIcon = (linkWeb?: string) => {
const link = document.querySelector('link[rel="icon"]')
if (link) {
if (linkWeb) {
link['href'] = baseUrl + linkWeb
} else {
link['href'] = '/dataease.svg'
}
}
}
export const useAppearanceStoreWithOut = () => {
return useAppearanceStore(store)
}