diff --git a/client/components/Postman/Postman.js b/client/components/Postman/Postman.js index e59146d9..08938d21 100755 --- a/client/components/Postman/Postman.js +++ b/client/components/Postman/Postman.js @@ -90,8 +90,8 @@ export default class Run extends Component { }) : 0; index = index === -1 ? 0 : index - let req_header = [].concat(this.props.data.req_headers); - let header = [].concat(env[index].header); + let req_header = [].concat((this.props.data.req_headers || [])); + let header = [].concat((env[index].header || [])); header.forEach(item => { if (!checkNameIsExistInArray(item.name, req_header)) { item = { diff --git a/client/containers/Project/Interface/InterfaceList/Edit.js b/client/containers/Project/Interface/InterfaceList/Edit.js index 338d2749..9d51aa9b 100755 --- a/client/containers/Project/Interface/InterfaceList/Edit.js +++ b/client/containers/Project/Interface/InterfaceList/Edit.js @@ -72,7 +72,7 @@ class InterfaceEdit extends Component { //因后端 node 仅支持 ws, 暂不支持 wss let wsProtocol = location.protocol === 'https' ? 'ws' : 'ws'; try { - s = new WebSocket(wsProtocol + '://' + domain + '/api/interface/solve_conflict?id=' + this.props.match.params.actionId); + s = new WebSocket(wsProtocol + '://dd' + domain + '/api/interface/solve_conflict?id=' + this.props.match.params.actionId); s.onopen = () => { this.WebSocket = s; } diff --git a/common/postmanLib.js b/common/postmanLib.js index 9d43ec91..41022a6c 100644 --- a/common/postmanLib.js +++ b/common/postmanLib.js @@ -17,13 +17,21 @@ const ContentTypeMap = { async function httpRequestByNode(options) { function handleRes(response){ + if(!response || typeof response !== 'object'){ return { res: { - header: response.headers, - status: response.status, - body: response.data + status: 500, + body: '请求出错' + isNode ? ', 内网服务器自动化测试无法访问到,请检查是否为内网服务器!': '' } } + } + return { + res: { + header: response.headers, + status: response.status, + body: response.data + } + } } function handleData(){