dev_forum
hjm 5 years ago
parent a4910c2f8f
commit a107be221c

@ -102,7 +102,7 @@ class Cropper extends Component {
setTimeout(() => { setTimeout(() => {
const image = document.getElementById(this.props.imageId || '__image'); const image = document.getElementById(this.props.imageId || '__image');
this.cropper = new window.Cropper(image, this.options); this.cropper = new window.Cropper(image, this.options);
}, 1000) }, 1200)
} }
renew = (image) => { renew = (image) => {

@ -194,7 +194,7 @@ class UseBank extends Component{
display: -webkit-flex; display: -webkit-flex;
} }
.setImgW .edu-nodata-img{ .setImgW .edu-nodata-img{
width:218px !important; width: 170px !important;
} }
.bankwidth{ .bankwidth{
width:24% !important; width:24% !important;

@ -105,11 +105,16 @@ class ChangeHeaderPicModal extends Component{
.then((response) => { .then((response) => {
// {"status":0,"message":"success","avatar_url":"avatars/User/15739"} // {"status":0,"message":"success","avatar_url":"avatars/User/15739"}
if (response.data.status == 0) { if (response.data.status == 0) {
// this.props.getBasicInfo() // this.props.getBasicInfo()
this.props.fetchUser() // https://www.trustie.net/issues/22461
// 头像更新后会触发AccountPage的DidUpdate然后会调用getBasicInfo if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1
this.props.showNotification && this.props.showNotification("修改头像成功") || this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) {
this.setVisible(false) this.setTimeout(() => {
this.doAfterUpdated()
}, 1000)
} else {
this.doAfterUpdated();
}
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -117,6 +122,12 @@ class ChangeHeaderPicModal extends Component{
}); });
}); });
} }
doAfterUpdated = () => {
this.props.fetchUser()
// 头像更新后会触发AccountPage的DidUpdate然后会调用getBasicInfo
this.props.showNotification && this.props.showNotification("修改头像成功")
this.setVisible(false)
}
render(){ render(){
const { course_lists } = this.state const { course_lists } = this.state

Loading…
Cancel
Save