Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
gaoxiaolin.gao 2018-04-13 12:04:58 +08:00
commit 32f82bea43
3 changed files with 14 additions and 6 deletions

View File

@ -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 = {

View File

@ -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;
}

View File

@ -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(){