Commit 4b57a3fd by 宋毅

tj

parent 4ba20d41
...@@ -207,25 +207,25 @@ class ExecClientNew { ...@@ -207,25 +207,25 @@ class ExecClientNew {
if (!ContentType) { if (!ContentType) {
ContentType = "application/json"; ContentType = "application/json";
} }
var data = null; var data = JSON.stringify(params);
if (typeof params === 'object') { // if (typeof params === 'object') {
// 声明cache变量,便于匹配是否有循环引用的情况 // // 声明cache变量,便于匹配是否有循环引用的情况
var cache = []; // var cache = [];
data = JSON.stringify(params, function (key, value) { // data = JSON.stringify(params, function (key, value) {
if (typeof value === 'object' && value !== null) { // if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) { // if (cache.indexOf(value) !== -1) {
// 移除 // // 移除
return; // return;
} // }
// 收集所有的值 // // 收集所有的值
cache.push(value); // cache.push(value);
} // }
return value; // return value;
}); // });
cache = null; // 清空变量,便于垃圾回收机制回收 // cache = null; // 清空变量,便于垃圾回收机制回收
} else { // } else {
data = params; // data = params;
} // }
var cmdStr = "curl --user admines:adminGSBes. -k -H 'Content-type:" + ContentType + "'"; var cmdStr = "curl --user admines:adminGSBes. -k -H 'Content-type:" + ContentType + "'";
if (headData) { if (headData) {
var headDataKeys = Object.keys(headData); var headDataKeys = Object.keys(headData);
......
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