feat: 保存用例

This commit is contained in:
zwjamnsss 2017-08-23 14:59:24 +08:00
parent b7ac596de5
commit ed53b51e6d
3 changed files with 7 additions and 5 deletions

View File

@ -50,7 +50,9 @@ export default class Run extends Component {
}
componentWillReceiveProps(nextProps) {
this.getInterfaceState(nextProps)
if (nextProps.data._id !== this.props.data._id) {
this.getInterfaceState(nextProps)
}
}
@autobind
@ -85,7 +87,7 @@ export default class Run extends Component {
}
const domains = env.concat();
if (domain && !env.find(item => item.domain === domain)) {
domains.push([{name: 'default', domain}])
domains.push({name: 'default', domain})
}
this.setState({
@ -97,7 +99,7 @@ export default class Run extends Component {
bodyForm: req_body_form.concat(),
headers: req_headers.concat(),
bodyOther: req_body_other,
currDomain: domain || env[0].domain,
currDomain: domain || (env[0] && env[0].domain),
bodyType: req_body_type || 'form',
loading: false
});

View File

@ -79,7 +79,7 @@ export default class InterfaceCaseContent extends Component {
render() {
const { currCase, currProject } = this.props;
const data = Object.assign({}, currCase, currProject);
const data = Object.assign({}, currCase, currProject, {_id: currCase._id});
return (
<div>
<h1 style={{marginLeft: 8}}>{currCase.casename}</h1>

View File

@ -82,7 +82,7 @@ export default class Run extends Component {
render () {
const { currInterface, currProject } = this.props;
const data = Object.assign({}, currInterface, currProject)
const data = Object.assign({}, currInterface, currProject, {_id: currInterface._id})
return (
<div>