Unverified Commit 144a9167 authored by sean1025's avatar sean1025 Committed by GitHub
Browse files

Merge pull request #1497 from tangcent/fix#1493

fix: use `sub` instead of `split` to parse parameters
parents bc77adc2 5e5c0097
......@@ -548,9 +548,12 @@ class InterfaceEditForm extends Component {
this.state.bulkValue.split('\n').forEach((item, index) => {
let valueItem = Object.assign({}, curValue[index] || dataTpl[this.state.bulkName]);
valueItem.name = item.split(':')[0];
valueItem.example = item.split(':')[1] || '';
newValue.push(valueItem);
let indexOfColon = item.indexOf(':');
if (indexOfColon!==-1) {
valueItem.name = item.substring(0, indexOfColon);
valueItem.example = item.substring(indexOfColon + 1) || '';
newValue.push(valueItem);
}
});
this.props.form.setFieldsValue({[this.state.bulkName]: newValue});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment