Commit 2ac5f39c by 兰国旗

添加windows访问curl的json格式

parent 2ce0c4df
......@@ -13,8 +13,8 @@ class ExecClient {
async exec(cmd) {
//await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
//异常需要try/catch自己捕获或外部catch捕获
const {stdout, stderr} = await exec(cmd);
return {stdout, stderr};
const { stdout, stderr } = await exec(cmd);
return { stdout, stderr };
}
getUUID() {
......@@ -59,7 +59,7 @@ class ExecClient {
}
async exec2(cmd) {
return exec(cmd, {encoding: "base64"});
return exec(cmd, { encoding: "base64" });
}
FetchPostCmd(subData, url) {
......@@ -71,9 +71,22 @@ class ExecClient {
}
async execPost(subData, url) {
//本机windows curl json格式
// if (settings.env == 'dev') {
// const rs = await axios.post(url, subData, {
// auth: {
// username: "admines",
// password: "adminGSBes"
// }
// });
// const ret = {
// stdout: JSON.stringify(rs.data)
// }
// return ret;
// }
let cmd = this.FetchPostCmd(subData, url);
var result = await this.exec(cmd);
return result;
}
......@@ -109,8 +122,8 @@ class ExecClient {
var options = {
timeout: timeOut,
};
const {stdout, stderr} = await exec(cmd, options);
return {stdout, stderr};
const { stdout, stderr } = await exec(cmd, options);
return { stdout, stderr };
}
}
......
var settings={
redis:{
var settings = {
redis: {
host: "43.247.184.32",
port: 8967,
password: "Gongsibao2018",
db:10,
db: 10,
},
database:{
dbname : "igirl_api",
database: {
dbname: "igirl_api",
user: "write",
password: "write",
config: {
host: '43.247.184.35',
port: 8899,
dialect: 'mysql',
operatorsAliases: false,
pool: {
max: 5,
min: 0,
acquire: 90000000,
idle: 1000000
},
debug:false,
dialectOptions:{
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
}
},
reqEsDevUrl:"http://192.168.4.249:9200/",
reqHomePageDevUrl:"http://zcapi.apps.com:4002/",
reqAuthUrl:"http://sj.app.com:4002/auth"
operatorsAliases: false,
pool: {
max: 5,
min: 0,
acquire: 90000000,
idle: 1000000
},
debug: false,
dialectOptions: {
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
}
},
reqEsDevUrl: "http://192.168.4.249:9200/",
reqHomePageDevUrl: "http://zcapi.apps.com:4002/",
reqAuthUrl: "http://sj.app.com:4002/auth"
};
module.exports = settings;
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