From 0eebb5289a5d0fc3d4dcce2b1cc67dabc72230c5 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 5 Jul 2022 09:56:36 +0800 Subject: [PATCH] =?UTF-8?q?style(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=8C=E7=BB=99=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=BC=80=E6=BA=90=E7=89=88=E8=AE=BE=E7=BD=AE=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/App.vue | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index 9fb477ee27..4bf859d9a7 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -86,6 +86,7 @@ export default { this.initSessionTimer(); if (!hasLicense()) { setDefaultTheme(); + setCustomizeColor(); this.color = ORIGIN_COLOR; } else { this.$get('/system/theme', res => { @@ -93,7 +94,7 @@ export default { setColor(this.color, this.color, this.color, this.color, this.color); this.$store.commit('setTheme', res.data); }); - this.query(); + this.getDisplayInfo(); } // OIDC redirect 之后不跳转 if (window.location.href.endsWith('#/refresh')) { @@ -147,25 +148,29 @@ export default { }; }, methods: { - query() { + getDisplayInfo() { this.result = this.$get("/display/info", response => { let theme = ""; if (response.data && response.data[5] && response.data[5].paramValue) { theme = response.data[5].paramValue; } if (response.data && response.data[7] && response.data[7].paramValue) { - this.setAsideTheme(response.data[7].paramValue, theme); + this.sideTheme = response.data[7].paramValue; } + this.setAsideTheme(theme); }) }, - setAsideTheme(sideTheme, theme) { - this.sideTheme = sideTheme; - if (sideTheme === "theme-light") { - setLightColor(); - } else if (sideTheme === "theme-default") { - setAsideColor(); - } else { - setCustomizeColor(theme); + setAsideTheme(theme) { + switch (this.sideTheme) { + case "theme-light": + setLightColor(); + break; + case "theme-default": + setAsideColor(); + break; + default: + setCustomizeColor(theme); + break; } }, fixedChange(isFixed) {