From ed53b51e6dda6b5e49b14874655558d075890109 Mon Sep 17 00:00:00 2001 From: zwjamnsss Date: Wed, 23 Aug 2017 14:59:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=9D=E5=AD=98=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Postman/Postman.js | 8 +++++--- .../Interface/InterfaceCol/InterfaceCaseContent.js | 2 +- .../containers/Project/Interface/InterfaceList/Run/Run.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/components/Postman/Postman.js b/client/components/Postman/Postman.js index a15f069f..a42442ab 100644 --- a/client/components/Postman/Postman.js +++ b/client/components/Postman/Postman.js @@ -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 }); diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js b/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js index 606970ef..e9a4d605 100644 --- a/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js @@ -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 (

{currCase.casename}

diff --git a/client/containers/Project/Interface/InterfaceList/Run/Run.js b/client/containers/Project/Interface/InterfaceList/Run/Run.js index 5a55293b..1ac9de7f 100644 --- a/client/containers/Project/Interface/InterfaceList/Run/Run.js +++ b/client/containers/Project/Interface/InterfaceList/Run/Run.js @@ -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 (