|
|
@ -106,10 +106,15 @@ class ChangeHeaderPicModal extends Component{
|
|
|
|
// {"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
|
|
|
|