修复客户平台图标加载
This commit is contained in:
@@ -817,13 +817,20 @@ function applyDocumentBrand() {
|
||||
return;
|
||||
}
|
||||
document.title = platformName.value || defaultPlatformName;
|
||||
let icon = document.querySelector('link[rel="icon"]');
|
||||
const iconUrl = platformLogo.value || defaultPlatformLogo;
|
||||
setDocumentIcon('icon', iconUrl);
|
||||
setDocumentIcon('shortcut icon', iconUrl);
|
||||
setDocumentIcon('apple-touch-icon', iconUrl);
|
||||
}
|
||||
|
||||
function setDocumentIcon(rel, href) {
|
||||
let icon = document.querySelector(`link[rel="${rel}"]`);
|
||||
if (!icon) {
|
||||
icon = document.createElement('link');
|
||||
icon.setAttribute('rel', 'icon');
|
||||
icon.setAttribute('rel', rel);
|
||||
document.head.appendChild(icon);
|
||||
}
|
||||
icon.setAttribute('href', platformLogo.value || defaultPlatformLogo);
|
||||
icon.setAttribute('href', href);
|
||||
}
|
||||
|
||||
function handleBrandLogoError() {
|
||||
|
||||
Reference in New Issue
Block a user