fix: 个人中心头像为空时不能修改

(cherry picked from commit e6a9dd0e4c)
This commit is contained in:
xingyu
2023-08-28 17:53:45 +08:00
committed by shizhong
parent a15d777afb
commit bdaeb75ccc
2 changed files with 19 additions and 21 deletions

View File

@ -4,7 +4,7 @@
ref="cropperRef"
:btnProps="{ preIcon: 'ant-design:cloud-upload-outlined' }"
:showBtn="false"
:value="avatar"
:value="img"
width="120px"
@change="handelUpload"
/>
@ -14,12 +14,11 @@
import { propTypes } from '@/utils/propTypes'
import { uploadAvatarApi } from '@/api/system/user/profile'
const props = defineProps({
defineOptions({ name: 'UserAvatar' })
defineProps({
img: propTypes.string.def('')
})
const avatar = computed(() => {
return props.img
})
const cropperRef = ref()
const handelUpload = async ({ data }) => {