Merge pull request #62 from Undertone0809/avatar-patch

fix: can not render and change avatar normally.
This commit is contained in:
ronger 2022-11-01 07:50:05 +08:00 committed by GitHub
commit c639157bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,9 +158,9 @@ export default {
if (res.message) { if (res.message) {
_ts.$message.error(res.message); _ts.$message.error(res.message);
} else { } else {
_ts.$set(_ts, 'user', res.user); _ts.$set(_ts, 'user', res);
_ts.$set(_ts, 'avatarUrl', res.user.avatarUrl); _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
_ts.$refs.cropper.replace(res.user.avatarUrl); _ts.$refs.cropper.replace(res.avatarUrl);
// _ts.webImageToBase64(res.user.avatarUrl); // _ts.webImageToBase64(res.user.avatarUrl);
} }
} }
@ -192,9 +192,9 @@ export default {
if (res.message) { if (res.message) {
_ts.$message.error(res.message); _ts.$message.error(res.message);
} else { } else {
_ts.$set(_ts, 'user', res.user); _ts.$set(_ts, 'user', res);
_ts.$set(_ts, 'avatarUrl', res.user.avatarUrl); _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
_ts.$store.commit('setUserInfo', res.user); _ts.$store.commit('setUserInfo', res);
_ts.$message.success('更新成功 !'); _ts.$message.success('更新成功 !');
} }
} }