判断逻辑有问题

pull/475/head
shizhong 2024-06-26 12:11:30 +08:00
parent aa32579a37
commit e6c10aa306
2 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,8 @@ const props = defineProps({
}) })
const userStore = useUserStore() 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 userName = computed(() => userStore.user.nickname ?? 'Admin')
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])

View File

@ -22,7 +22,8 @@ const showDate = ref(true)
const { getPrefixCls } = useDesign() const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('lock-page') 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 userName = computed(() => userStore.user.nickname ?? 'Admin')
const lockStore = useLockStore() const lockStore = useLockStore()