Commit e7482241 by 任晓松

Revert "update"

This reverts commit fdecf198
parent fdecf198
...@@ -4,7 +4,6 @@ const exec = util.promisify(require('child_process').exec); ...@@ -4,7 +4,6 @@ const exec = util.promisify(require('child_process').exec);
const querystring = require('querystring'); const querystring = require('querystring');
var settings = require("../../config/settings"); var settings = require("../../config/settings");
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
const axios = require('axios')
class RestClient { class RestClient {
constructor() { constructor() {
this.cmdGetPattern = "curl {-G} -k -d '{data}' {url}"; this.cmdGetPattern = "curl {-G} -k -d '{data}' {url}";
...@@ -88,13 +87,6 @@ class RestClient { ...@@ -88,13 +87,6 @@ class RestClient {
return result; return result;
} }
async execPost(subData, url) { async execPost(subData, url) {
if(settings.env == 'dev'){
const rs = await axios.post(url,subData);
const ret ={
stdout:JSON.stringify(rs.data)
}
return ret;
}
let cmd = this.FetchPostCmd(subData, url); let cmd = this.FetchPostCmd(subData, url);
var result = await this.exec(cmd, { var result = await this.exec(cmd, {
maxBuffer: 10000 * 1024 maxBuffer: 10000 * 1024
...@@ -102,11 +94,6 @@ class RestClient { ...@@ -102,11 +94,6 @@ class RestClient {
return result; return result;
} }
async execPostWithAK(subData, url, ak) { async execPostWithAK(subData, url, ak) {
if(settings.env == 'dev'){
axios.defaults.headers['AccessKey'] = ak;
const rs = await axios.post(url,subData);
return rs.data;
}
let cmd = this.FetchPostCmdWithAK(subData, url, ak); let cmd = this.FetchPostCmdWithAK(subData, url, ak);
var result = await this.exec(cmd, { var result = await this.exec(cmd, {
maxBuffer: 1024 * 1024 * 15 maxBuffer: 1024 * 1024 * 15
...@@ -119,13 +106,6 @@ class RestClient { ...@@ -119,13 +106,6 @@ class RestClient {
} }
} }
async execPost2(subData, url) { async execPost2(subData, url) {
if(settings.env == 'dev'){
const rs = await axios.post(url,subData);
const ret ={
stdout:JSON.stringify(rs.data)
}
return ret;
}
let cmd = this.FetchPostCmd2(subData, url); let cmd = this.FetchPostCmd2(subData, url);
console.log(cmd); console.log(cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
......
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