From 4f64b840b0306dc0f6bd42931fb3b2b59e475a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Tue, 23 Nov 2021 14:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20fork=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=8E=9F=E5=9B=A0=E4=B8=BA=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=A4=8D=E5=88=BB=E8=BF=87=E5=88=99=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E5=A4=8D=E5=88=BB=E4=BB=93=E5=BA=93=EF=BC=8C=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E3=80=90=E4=BB=93=E5=BA=93=EF=BC=9A=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=91=E6=98=BE=E7=A4=BA=E7=BB=9F=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 4 ++++ src/forge/Merge/CreateMerge.js | 5 ++--- src/forge/Merge/MergeItem.js | 4 ++-- src/forge/Merge/MessageCount.js | 2 +- src/forge/Merge/UpdateMerge.js | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 880b24a9..6fa8a0d4 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -423,6 +423,10 @@ class Detail extends Component { const url = `/${owner}/${projectsId}/forks.json`; axios.post(url).then(result => { if (result && result.data.status === 0) { + if(result.data.message === "fork失败,你已拥有了这个项目"){ + this.props.history.push(`/${current_user && current_user.login}/${projectsId}`); + return; + } this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`); this.props.showNotification(result.data.message); } diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index 7b676cb4..2dfa6f98 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -124,7 +124,6 @@ class CreateMerge extends Component { initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id}); } this.setState({isSpin: false}); - console.log('setTimeout state', this.state.data); // 如果url上的分支不存在,取默认值master const noMergeBranch = (result.data.branches || []).filter( @@ -363,7 +362,7 @@ class CreateMerge extends Component {