refactor: 删除保存系统参数后对icon的操作
This commit is contained in:
parent
d401340b84
commit
eed243d40c
|
@ -151,19 +151,11 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem("default-document-title", "MeterSphere");
|
localStorage.setItem("default-document-title", "MeterSphere");
|
||||||
}
|
}
|
||||||
if (response.data[0].paramValue) {
|
|
||||||
this.shortcutIcon();
|
|
||||||
}
|
|
||||||
this.setAsideTheme(theme);
|
this.setAsideTheme(theme);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
shortcutIcon() {
|
|
||||||
let link = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
|
||||||
link.type = 'image/x-icon';
|
|
||||||
link.rel = 'shortcut icon';
|
|
||||||
link.href = '/display/file/logo';
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(link);
|
|
||||||
},
|
|
||||||
setAsideTheme(theme) {
|
setAsideTheme(theme) {
|
||||||
switch (this.sideTheme) {
|
switch (this.sideTheme) {
|
||||||
case "theme-light":
|
case "theme-light":
|
||||||
|
|
|
@ -178,9 +178,6 @@ export default {
|
||||||
if (title) {
|
if (title) {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
}
|
}
|
||||||
if (response.data[0].paramValue) {
|
|
||||||
this.shortcutIcon();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -304,13 +301,6 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shortcutIcon() {
|
|
||||||
let link = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
|
||||||
link.type = 'image/x-icon';
|
|
||||||
link.rel = 'shortcut icon';
|
|
||||||
link.href = '/display/file/logo';
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(link);
|
|
||||||
},
|
|
||||||
redirectAuth(authId) {
|
redirectAuth(authId) {
|
||||||
if (authId === 'LDAP' || authId === 'LOCAL') {
|
if (authId === 'LDAP' || authId === 'LOCAL') {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -249,9 +249,6 @@ export default {
|
||||||
if (this.formInline.sideTheme) {
|
if (this.formInline.sideTheme) {
|
||||||
localStorage.setItem("sideTheme", this.formInline.sideTheme);
|
localStorage.setItem("sideTheme", this.formInline.sideTheme);
|
||||||
}
|
}
|
||||||
if (this.formInline.logo) {
|
|
||||||
this.shortcutIcon();
|
|
||||||
}
|
|
||||||
this.setAsideTheme();
|
this.setAsideTheme();
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
@ -370,20 +367,10 @@ export default {
|
||||||
this.formInline.css = response.data[8].paramValue;
|
this.formInline.css = response.data[8].paramValue;
|
||||||
this.cssList.push({name: response.data[8].fileName, db: true});
|
this.cssList.push({name: response.data[8].fileName, db: true});
|
||||||
}
|
}
|
||||||
if (response.data[0].paramValue) {
|
|
||||||
this.shortcutIcon();
|
|
||||||
}
|
|
||||||
this.setAsideTheme();
|
this.setAsideTheme();
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
shortcutIcon() {
|
|
||||||
let link = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
|
||||||
link.type = 'image/x-icon';
|
|
||||||
link.rel = 'shortcut icon';
|
|
||||||
link.href = '/display/file/logo';
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(link);
|
|
||||||
},
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.showEdit = true;
|
this.showEdit = true;
|
||||||
this.showCancel = false;
|
this.showCancel = false;
|
||||||
|
|
Loading…
Reference in New Issue