Skip to content

Commit

Permalink
perf: 优化账号设置-头像上传功能
Browse files Browse the repository at this point in the history
  • Loading branch information
shuTwT authored Apr 19, 2024
1 parent d203222 commit ada3e80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/account-settings/components/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defineOptions({
});
const imgSrc = ref("");
const cropperInfo = ref();
const cropperBlob = ref();
const cropRef = ref();
const uploadRef = ref();
const isShow = ref(false);
Expand Down Expand Up @@ -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 }) => {
Expand Down

0 comments on commit ada3e80

Please sign in to comment.