mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 12:18:43 +08:00 
			
		
		
		
	fix: 个人中心头像为空时不能修改
This commit is contained in:
		@@ -4,7 +4,7 @@
 | 
			
		||||
      ref="cropperRef"
 | 
			
		||||
      :btnProps="{ preIcon: 'ant-design:cloud-upload-outlined' }"
 | 
			
		||||
      :showBtn="false"
 | 
			
		||||
      :value="avatar"
 | 
			
		||||
      :value="img"
 | 
			
		||||
      width="120px"
 | 
			
		||||
      @change="handelUpload"
 | 
			
		||||
    />
 | 
			
		||||
@@ -13,15 +13,13 @@
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { propTypes } from '@/utils/propTypes'
 | 
			
		||||
import { uploadAvatar } from '@/api/system/user/profile'
 | 
			
		||||
import { CropperAvatar } from '@/components/Cropper'
 | 
			
		||||
 | 
			
		||||
defineOptions({ name: 'UserAvatar' })
 | 
			
		||||
 | 
			
		||||
const props = defineProps({
 | 
			
		||||
defineProps({
 | 
			
		||||
  img: propTypes.string.def('')
 | 
			
		||||
})
 | 
			
		||||
const avatar = computed(() => {
 | 
			
		||||
  return props.img
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
const cropperRef = ref()
 | 
			
		||||
const handelUpload = async ({ data }) => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user