mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: 优化账号设置-头像上传功能
This commit is contained in:
		
							parent
							
								
									d203222acf
								
							
						
					
					
						commit
						ada3e80c7e
					
				@ -13,7 +13,7 @@ defineOptions({
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const imgSrc = ref("");
 | 
			
		||||
const cropperInfo = ref();
 | 
			
		||||
const cropperBlob = ref();
 | 
			
		||||
const cropRef = ref();
 | 
			
		||||
const uploadRef = ref();
 | 
			
		||||
const isShow = ref(false);
 | 
			
		||||
@ -66,11 +66,11 @@ const handleClose = () => {
 | 
			
		||||
  isShow.value = false;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const onCropper = info => (cropperInfo.value = info);
 | 
			
		||||
const onCropper = ({ blob }) => (cropperBlob.value = blob);
 | 
			
		||||
 | 
			
		||||
const handleSubmitImage = () => {
 | 
			
		||||
  const formData = createFormData({
 | 
			
		||||
    files: new File([cropperInfo.value], "avatar")
 | 
			
		||||
    files: new File([cropperBlob.value], "avatar")
 | 
			
		||||
  });
 | 
			
		||||
  formUpload(formData)
 | 
			
		||||
    .then(({ success, data }) => {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user