perf: 头像上传组件返回值增加后端接口的返回值 (#2244)

This commit is contained in:
acdxxx177 2022-10-02 06:12:01 +08:00 committed by GitHub
parent 692df33fd8
commit dfe560a542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -91,9 +91,9 @@
}, },
); );
function handleUploadSuccess({ source }) { function handleUploadSuccess({ source, data }) {
sourceValue.value = source; sourceValue.value = source;
emit('change', source); emit('change', { source, data });
createMessage.success(t('component.cropper.uploadSuccess')); createMessage.success(t('component.cropper.uploadSuccess'));
} }

View File

@ -65,10 +65,11 @@
return avatar || headerImg; return avatar || headerImg;
}); });
function updateAvatar(src: string) { function updateAvatar({ src, data }) {
const userinfo = userStore.getUserInfo; const userinfo = userStore.getUserInfo;
userinfo.avatar = src; userinfo.avatar = src;
userStore.setUserInfo(userinfo); userStore.setUserInfo(userinfo);
console.log('data', data);
} }
return { return {