diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 39eee8fe..da208469 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -202,7 +202,7 @@ class Detail extends Component{ if(!flag){ const url = `/projects/${project_id}/watchers/follow.json`; axios.post(url).then(result=>{ - if(result){ + if(result && result.data.status === 0){ this.props.showNotification('关注成功'); this.getDetail(); } @@ -212,7 +212,7 @@ class Detail extends Component{ }else{ const url = `/projects/${project_id}/watchers/unfollow.json`; axios.delete(url).then(result=>{ - if(result){ + if(result && result.data.status === 0){ this.props.showNotification('取消关注成功'); this.getDetail(); } @@ -228,7 +228,7 @@ class Detail extends Component{ if(!flag){ const url = `/projects/${project_id}/praise_tread/like.json`; axios.post(url).then(result=>{ - if(result){ + if(result && result.data.status === 0){ this.props.showNotification('点赞成功'); this.getDetail(); } @@ -238,7 +238,7 @@ class Detail extends Component{ }else{ const url = `/projects/${project_id}/praise_tread/unlike.json`; axios.delete(url).then(result=>{ - if(result){ + if(result && result.data.status === 0){ this.props.showNotification('取消点赞成功'); this.getDetail(); }