mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
feat: 保存用例
This commit is contained in:
parent
b7ac596de5
commit
ed53b51e6d
@ -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
|
||||
});
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user