diff --git a/client/containers/AddInterface/InterfaceTest/InterfaceTest.js b/client/containers/AddInterface/InterfaceTest/InterfaceTest.js index b8052ee9..ba835fc6 100644 --- a/client/containers/AddInterface/InterfaceTest/InterfaceTest.js +++ b/client/containers/AddInterface/InterfaceTest/InterfaceTest.js @@ -138,8 +138,18 @@ export default class InterfaceTest extends Component { data: params, success: (res, header) => { console.log(header) + try { + res = JSON.parse(res); + } catch (e) { + null; + } this.setState({res}) this.setState({ loading: false }) + }, + error: (err, header) => { + console.log(header) + this.setState({res: err || '请求失败'}) + this.setState({ loading: false }) } }) } @@ -285,7 +295,7 @@ export default class InterfaceTest extends Component {