forked from Gitlink/forgeplus-react
非.git结尾的也需要自动填充
This commit is contained in:
parent
1aa6c05869
commit
95050bb3bd
|
@ -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: '请填写镜像版本库地址'
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="请输入需要导入到本项目的仓库地址" onChange={this.ChangeAddr} />
|
||||
<Input placeholder="请输入需要导入到本项目的仓库地址" onBlur={this.ChangeAddr} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<p className="formTip color-orange">示例:https://github.com/facebook/reack.git</p>
|
||||
|
|
Loading…
Reference in New Issue