From 9d29238017aa7665b9d42225b96e269cacf88199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Mon, 20 Jan 2025 14:26:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=BB=98=E8=AE=A4=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/layout/components/Aside.vue | 10 +++++++++- src/renderer/src/views/profile/userAvatar.vue | 14 +++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/layout/components/Aside.vue b/src/renderer/src/layout/components/Aside.vue index bde5ccd..d87208d 100644 --- a/src/renderer/src/layout/components/Aside.vue +++ b/src/renderer/src/layout/components/Aside.vue @@ -5,7 +5,7 @@ @@ -75,6 +75,9 @@ const activeId = ref('/home') const version = ref(pkc.version) const popoverRef = ref('') +// 默认图片 +const img = ref('') +const defaultImg = ['/img/avatar-default.jpg','/images/img-avatar.png','/src/assets/images/img-avatar.png'] //是否是基地人员 const isStadium = () => { @@ -224,6 +227,11 @@ const logout = () => { onMounted(() => { userStore.getDeptInfo() // getregisterinfo() + if(defaultImg.includes(userStore.user.avatar)){ + img.value = defaultUserImg + }else{ + img.value = dev_api.value + userStore.user.avatar + } }) diff --git a/src/renderer/src/views/profile/userAvatar.vue b/src/renderer/src/views/profile/userAvatar.vue index a0cc82e..755a3f6 100644 --- a/src/renderer/src/views/profile/userAvatar.vue +++ b/src/renderer/src/views/profile/userAvatar.vue @@ -19,7 +19,7 @@