FIX 完善fork功能提示语

This commit is contained in:
Jasder 2020-03-29 18:17:47 +08:00
parent a017c6f84d
commit 2b658e59fa
1 changed files with 8 additions and 6 deletions

View File

@ -242,14 +242,16 @@ class Detail extends Component{
const { project_id } = this.state;
const url = `/projects/${project_id}/forks.json`;
axios.post(url).then(result=>{
if(result && result.data.status === 0){
this.props.history.push(`/projects/${result.data.id}/coders`);
this.props.showNotification(result.data.message);
this.setState({
if (result) {
if (result.data.status === 0) {
this.props.history.push(`/projects/${result.data.id}/coders`);
}
this.setState({
isSpin:false
})
}else{
this.props.showNotification(result.data.message);
this.props.showNotification(result.data.message);
} else {
this.props.showNotification(`服务器开小差了`);
}
}).catch(error=>{
console.log(error);