From 2b658e59faf75ef84ec5cb7e956a60f8d9387833 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sun, 29 Mar 2020 18:17:47 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E5=AE=8C=E5=96=84fork=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 05376c6c0..17536164d 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -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);