From fc3bd33713e4d1fc8b07b9fed2012d7795c4df19 Mon Sep 17 00:00:00 2001 From: yangzhe Date: Wed, 28 Jan 2026 15:51:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=A4=B4=E5=83=8F=E5=A4=84=E7=90=86):?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=20$getHeadImgUrl=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=94=9F=E6=88=90=E5=A4=B4=E5=83=8F=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ChatHistory.vue | 6 +----- pages/home/userSetting/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/components/ChatHistory.vue b/components/ChatHistory.vue index 865d7da..aac6ad8 100644 --- a/components/ChatHistory.vue +++ b/components/ChatHistory.vue @@ -197,11 +197,7 @@ export default { }, headSculptureUrl() { - if (this.vuex_user.HeadSculptureUrl) { - return this.baseUrl + "/" + this.vuex_user.HeadSculptureUrl; - } - - return "/static/common/images/avatar.png"; + return this.$getHeadImgUrl(this.vuex_user.HeadSculptureUrl); }, }, diff --git a/pages/home/userSetting/index.vue b/pages/home/userSetting/index.vue index 92b8fc1..9c807b9 100644 --- a/pages/home/userSetting/index.vue +++ b/pages/home/userSetting/index.vue @@ -242,7 +242,7 @@ export default { this.imageUrl = data.headSculptureUrl; this.imageValue = [ { - url: this.baseUrl + "/" + data.headSculptureUrl, + url: this.$getHeadImgUrl(data.headSculptureUrl), extname: "png", name: "", }, @@ -251,7 +251,7 @@ export default { this.imageUrl = ""; this.imageValue = [ { - url: "/static/common/images/avatar_default2.png", + url: this.$getHeadImgUrl(this.vuex_user.HeadSculptureUrl), extname: "jpg", name: "", },