From 95050bb3bd2cda20b772ba5d2e8ff9ee204072eb Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 15 Oct 2021 10:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E.git=E7=BB=93=E5=B0=BE=E7=9A=84?= =?UTF-8?q?=E4=B9=9F=E9=9C=80=E8=A6=81=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/New/Index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index c6eb2c3d5..e9aa1f952 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -285,12 +285,16 @@ class Index extends Component { if(value.indexOf("/") > -1){ let arr = value.split("/"); let first = arr[arr.length-1]; - if(first.indexOf(".git") > -1){ + if(first.indexOf(".") > -1){ let second = first.split('.')[0]; if(!second)return; this.props.form.setFieldsValue({ repository_name:second }) + }else{ + this.props.form.setFieldsValue({ + repository_name:first + }) } } } @@ -351,7 +355,7 @@ class Index extends Component { required: true, message: '请填写镜像版本库地址' }], })( - + )}

示例:https://github.com/facebook/reack.git