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