Commit 16a68e13 by 任晓松

update

parent f651d54a
......@@ -34,50 +34,50 @@ class ExecClientNew {
}
}
try {
// if (settings.env === "localhost" || settings.env === "dev") {
// var headers = {
// 'Content-type': 'application/json'
// }
// if (headData) {
// var headDataKeys = Object.keys(headData);
// if (headDataKeys.length > 0) {
// for (let index = 0; index < headDataKeys.length; index++) {
// const indexKey = headDataKeys[index];
// var headValue = headData[indexKey];
// if (indexKey && headValue) {
// headers[indexKey] = headValue;
// }
// }
// }
// }
// axios.default.timeout = timeOut;
// let result = await axios({
// // headers: {'Content-Type': 'application/x-www-form-urlencoded'},
// headers: headers,
// method: 'POST',
// url: url,
// data: JSON.stringify(params)
// });
// if (result.status == 200) {
// reqResult = system.getResultSuccess(result.data);
//
// } else {
// reqResult = system.getResult(null, "执行execPostTimeOutByBusiness存在错误");
// }
// reqResult.requestId = requestId || uuid.v1();
// if (result.headers) {
// delete result["headers"];
// }
// if (result.request) {
// delete result["request"];
// }
// if (result.config) {
// delete result["config"];
// }
// params.reqUrl = url;
// this.execLogs(execFile + "执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果", params, params.identifyCode, reqResult, result);
// return reqResult;
// }
if (settings.env === "localhost" || settings.env === "dev") {
var headers = {
'Content-type': 'application/json'
}
if (headData) {
var headDataKeys = Object.keys(headData);
if (headDataKeys.length > 0) {
for (let index = 0; index < headDataKeys.length; index++) {
const indexKey = headDataKeys[index];
var headValue = headData[indexKey];
if (indexKey && headValue) {
headers[indexKey] = headValue;
}
}
}
}
axios.default.timeout = timeOut;
let result = await axios({
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
headers: headers,
method: 'POST',
url: url,
data: JSON.stringify(params)
});
if (result.status == 200) {
reqResult = system.getResultSuccess(result.data);
} else {
reqResult = system.getResult(null, "执行execPostTimeOutByBusiness存在错误");
}
reqResult.requestId = requestId || uuid.v1();
if (result.headers) {
delete result["headers"];
}
if (result.request) {
delete result["request"];
}
if (result.config) {
delete result["config"];
}
params.reqUrl = url;
this.execLogs(execFile + "执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果", params, params.identifyCode, reqResult, result);
return reqResult;
}
//方式二
rtn = await this.execPostTimeOut(params, url, ContentType, headData, timeOut);
params.reqUrl = url;
......@@ -182,7 +182,6 @@ class ExecClientNew {
ContentType = "application/json";
}
let cmd = this.FetchPostCmd(params, url, ContentType, headData);
console.log(cmd)
var options = {
timeout: timeOut,
maxBuffer: 1024 * 1024 * 15
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment