From eed243d40c1f65827a360a2d22cec2eff98d5593 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 8 Aug 2023 11:10:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E5=90=8E=E5=AF=B9?= =?UTF-8?q?icon=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/business/app-layout/index.vue | 12 ++---------- .../frontend/src/business/login/index.vue | 10 ---------- .../src/business/system/setting/MxDisplay.vue | 13 ------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/framework/sdk-parent/frontend/src/business/app-layout/index.vue b/framework/sdk-parent/frontend/src/business/app-layout/index.vue index 77de02cb17..df3ba3a562 100644 --- a/framework/sdk-parent/frontend/src/business/app-layout/index.vue +++ b/framework/sdk-parent/frontend/src/business/app-layout/index.vue @@ -151,19 +151,11 @@ export default { } else { localStorage.setItem("default-document-title", "MeterSphere"); } - if (response.data[0].paramValue) { - this.shortcutIcon(); - } + 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) { switch (this.sideTheme) { case "theme-light": diff --git a/framework/sdk-parent/frontend/src/business/login/index.vue b/framework/sdk-parent/frontend/src/business/login/index.vue index 13dad25991..687ce21800 100644 --- a/framework/sdk-parent/frontend/src/business/login/index.vue +++ b/framework/sdk-parent/frontend/src/business/login/index.vue @@ -178,9 +178,6 @@ export default { if (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) { if (authId === 'LDAP' || authId === 'LOCAL') { return; diff --git a/system-setting/frontend/src/business/system/setting/MxDisplay.vue b/system-setting/frontend/src/business/system/setting/MxDisplay.vue index c434b4b9a3..8eac594d85 100644 --- a/system-setting/frontend/src/business/system/setting/MxDisplay.vue +++ b/system-setting/frontend/src/business/system/setting/MxDisplay.vue @@ -249,9 +249,6 @@ export default { if (this.formInline.sideTheme) { localStorage.setItem("sideTheme", this.formInline.sideTheme); } - if (this.formInline.logo) { - this.shortcutIcon(); - } this.setAsideTheme(); this.$success(this.$t('commons.save_success')); window.location.reload(); @@ -370,20 +367,10 @@ export default { this.formInline.css = response.data[8].paramValue; this.cssList.push({name: response.data[8].fileName, db: true}); } - if (response.data[0].paramValue) { - this.shortcutIcon(); - } 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() { this.showEdit = true; this.showCancel = false;