diff --git a/client/containers/AddInterface/AddInterface.js b/client/containers/AddInterface/AddInterface.js index bf347b93..9f5a0060 100644 --- a/client/containers/AddInterface/AddInterface.js +++ b/client/containers/AddInterface/AddInterface.js @@ -76,7 +76,8 @@ class AddInterface extends Component { isLoading: '', isSave: false, mockJson: '', - mockURL: '' + mockURL: '', + projectData: {} } } @@ -128,7 +129,8 @@ class AddInterface extends Component { const { protocol, prd_host, basepath } = data.data.data const mockURL = `${protocol}://${prd_host}${basepath}${result.path}` this.setState({ - mockURL: mockURL + mockURL: mockURL, + projectData: data.data.data }) }) } @@ -136,7 +138,9 @@ class AddInterface extends Component { editState (data) { const props = this.props const { path, title, req_params_other, res_body, req_headers, project_id, method } = data - + this.setState({ + apiData: data + }) props.pushInputValue(path) props.pushInterfaceMethod(method) props.pushInterfaceName(title) @@ -254,7 +258,7 @@ class AddInterface extends Component { - +

返回部分

diff --git a/client/containers/AddInterface/AddInterface.scss b/client/containers/AddInterface/AddInterface.scss index c1be5730..5402c751 100644 --- a/client/containers/AddInterface/AddInterface.scss +++ b/client/containers/AddInterface/AddInterface.scss @@ -9,12 +9,13 @@ font-size: .12rem; .content { - @include row-width-limit; - margin: 24px auto; + max-width: 11.7rem; + min-width: 11.7rem; border-radius: 4px; - box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20); + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2); background: #FFF; padding: 10px 20px 50px 20px; + margin: 0 auto; .ant-tabs-content { padding: 0 0 50px 0; diff --git a/client/containers/AddInterface/MockUrl/MockUrl.js b/client/containers/AddInterface/MockUrl/MockUrl.js index 7b0edc0c..e8fed4f5 100644 --- a/client/containers/AddInterface/MockUrl/MockUrl.js +++ b/client/containers/AddInterface/MockUrl/MockUrl.js @@ -11,7 +11,9 @@ const success = () => { class MockUrl extends Component { static propTypes = { mockURL: PropTypes.string, - serverIp: PropTypes.string + serverIp: PropTypes.string, + mockData: PropTypes.string, + projectData: PropTypes.object } constructor(props) { @@ -35,13 +37,14 @@ class MockUrl extends Component { } render () { + console.log(this.props) const { serverIp } = this.props return (
mock地址 :

{this.props.mockURL}

-
请配置host ***.***.***.*** { serverIp }
+
{this.props.projectData.prd_host} { serverIp }
) }