diff --git a/src/components/card/UserCard.vue b/src/components/card/UserCard.vue index ea38dbe..0751878 100644 --- a/src/components/card/UserCard.vue +++ b/src/components/card/UserCard.vue @@ -144,7 +144,7 @@ const handleAvatarError = () => { watch( () => userCardData.userInfo.avatarThumb, (newValue) => { - showAvatar.value = newValue + showAvatar.value = newValue || default_avatar } ) diff --git a/src/views/layout/components/MyCard.vue b/src/views/layout/components/MyCard.vue index 11d0497..a3e7e76 100644 --- a/src/views/layout/components/MyCard.vue +++ b/src/views/layout/components/MyCard.vue @@ -37,7 +37,7 @@ const onClickAvatar = () => { router.push('/setting/personal') } -const showAvatar = ref(userData.user.avatarThumb) +const showAvatar = ref(userData.user.avatarThumb || default_avatar) const handleAvatarError = () => { showAvatar.value = default_avatar