From e6c10aa306efdac4989acf06a9682fbdb21e391c Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Wed, 26 Jun 2024 12:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/UserInfo/src/components/LockDialog.vue | 3 ++- src/layout/components/UserInfo/src/components/LockPage.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layout/components/UserInfo/src/components/LockDialog.vue b/src/layout/components/UserInfo/src/components/LockDialog.vue index f4ab7d4f..037cca17 100644 --- a/src/layout/components/UserInfo/src/components/LockDialog.vue +++ b/src/layout/components/UserInfo/src/components/LockDialog.vue @@ -21,7 +21,8 @@ const props = defineProps({ }) const userStore = useUserStore() -const avatar = computed(() => userStore.user.avatar ?? avatarImg) +const avatar = computed(() => (userStore.user?.avatar != null && userStore.user?.avatar != '') ? + userStore.user?.avatar : avatarImg) const userName = computed(() => userStore.user.nickname ?? 'Admin') const emit = defineEmits(['update:modelValue']) diff --git a/src/layout/components/UserInfo/src/components/LockPage.vue b/src/layout/components/UserInfo/src/components/LockPage.vue index 497dd37b..6b9bada5 100644 --- a/src/layout/components/UserInfo/src/components/LockPage.vue +++ b/src/layout/components/UserInfo/src/components/LockPage.vue @@ -22,7 +22,8 @@ const showDate = ref(true) const { getPrefixCls } = useDesign() const prefixCls = getPrefixCls('lock-page') -const avatar = computed(() => userStore.user.avatar ?? avatarImg) +const avatar = computed(() => (userStore.user?.avatar != null && userStore.user?.avatar != '') ? + userStore.user?.avatar : avatarImg) const userName = computed(() => userStore.user.nickname ?? 'Admin') const lockStore = useLockStore()