Commit 2ac5f39c by 兰国旗

添加windows访问curl的json格式

parent 2ce0c4df
...@@ -13,8 +13,8 @@ class ExecClient { ...@@ -13,8 +13,8 @@ class ExecClient {
async exec(cmd) { async exec(cmd) {
//await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值 //await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
//异常需要try/catch自己捕获或外部catch捕获 //异常需要try/catch自己捕获或外部catch捕获
const {stdout, stderr} = await exec(cmd); const { stdout, stderr } = await exec(cmd);
return {stdout, stderr}; return { stdout, stderr };
} }
getUUID() { getUUID() {
...@@ -59,7 +59,7 @@ class ExecClient { ...@@ -59,7 +59,7 @@ class ExecClient {
} }
async exec2(cmd) { async exec2(cmd) {
return exec(cmd, {encoding: "base64"}); return exec(cmd, { encoding: "base64" });
} }
FetchPostCmd(subData, url) { FetchPostCmd(subData, url) {
...@@ -71,6 +71,19 @@ class ExecClient { ...@@ -71,6 +71,19 @@ class ExecClient {
} }
async execPost(subData, url) { 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); let cmd = this.FetchPostCmd(subData, url);
var result = await this.exec(cmd); var result = await this.exec(cmd);
...@@ -109,8 +122,8 @@ class ExecClient { ...@@ -109,8 +122,8 @@ class ExecClient {
var options = { var options = {
timeout: timeOut, timeout: timeOut,
}; };
const {stdout, stderr} = await exec(cmd, options); const { stdout, stderr } = await exec(cmd, options);
return {stdout, stderr}; return { stdout, stderr };
} }
} }
......
var settings={ var settings = {
redis:{ redis: {
host: "43.247.184.32", host: "43.247.184.32",
port: 8967, port: 8967,
password: "Gongsibao2018", password: "Gongsibao2018",
db:10, db: 10,
}, },
database:{ database: {
dbname : "igirl_api", dbname: "igirl_api",
user: "write", user: "write",
password: "write", password: "write",
config: { config: {
...@@ -20,15 +20,15 @@ var settings={ ...@@ -20,15 +20,15 @@ var settings={
acquire: 90000000, acquire: 90000000,
idle: 1000000 idle: 1000000
}, },
debug:false, debug: false,
dialectOptions:{ dialectOptions: {
requestTimeout: 999999, requestTimeout: 999999,
// instanceName:'DEV' // instanceName:'DEV'
} //设置MSSQL超时时间 } //设置MSSQL超时时间
} }
}, },
reqEsDevUrl:"http://192.168.4.249:9200/", reqEsDevUrl: "http://192.168.4.249:9200/",
reqHomePageDevUrl:"http://zcapi.apps.com:4002/", reqHomePageDevUrl: "http://zcapi.apps.com:4002/",
reqAuthUrl:"http://sj.app.com:4002/auth" reqAuthUrl: "http://sj.app.com:4002/auth"
}; };
module.exports = settings; 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