From 8be2ffa95704f5ea74abc28cd490421ca26afea3 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 2 May 2022 00:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=A7=86=E5=9B=BE=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=9B=BE=E7=89=87=E4=BD=BF=E7=94=A8=20base64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ConfigurationMenu.vue | 3 ++- src/pages/ConfigurationPage.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ConfigurationMenu.vue b/src/components/ConfigurationMenu.vue index ac52edb..b5f5d4b 100644 --- a/src/components/ConfigurationMenu.vue +++ b/src/components/ConfigurationMenu.vue @@ -431,7 +431,8 @@ export default { }, // 修改面板视图背景 changeBackground(reset = false) { - this.$root.profile.backgroundImg = reset ? null : this.selectFile.path; + let base64 = window.getBase64Ico(this.selectFile.path); + this.$root.profile.backgroundImg = reset ? null : base64; this.configurationPage.$forceUpdate(); }, // 取消收藏 diff --git a/src/pages/ConfigurationPage.vue b/src/pages/ConfigurationPage.vue index dd79328..957685c 100644 --- a/src/pages/ConfigurationPage.vue +++ b/src/pages/ConfigurationPage.vue @@ -47,7 +47,7 @@ left: tabBarWidth, background: commandCardStyle === 'mini' && $root.profile.backgroundImg - ? 'url(file:///' + $root.profile.backgroundImg + ')' + ? `url('${$root.profile.backgroundImg}')` : 'none', backgroundSize: 'cover', }"