Commit 0c33a763 by 兰国旗

百度公司注册套餐

parent 8bf4ecab
...@@ -41,13 +41,26 @@ class ExecClient { ...@@ -41,13 +41,26 @@ class ExecClient {
console.log(cmd); console.log(cmd);
return cmd; return cmd;
} }
Fetch360TokenCmd(subData,url){ Fetch360TokenCmd(subData, url) {
let cmd = this.cmd360Token.replace( let cmd = this.cmd360Token.replace(
/\{data\}/g, subData).replace(/\{url\}/g, url); /\{data\}/g, subData).replace(/\{url\}/g, url);
console.log(cmd); console.log(cmd);
return cmd; return cmd;
} }
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);
return result; return result;
...@@ -62,9 +75,9 @@ class ExecClient { ...@@ -62,9 +75,9 @@ class ExecClient {
var result = await this.exec2(cmd); var result = await this.exec2(cmd);
return result; return result;
} }
async exec360GetToken(url){ async exec360GetToken(url) {
const qs = require('qs') const qs = require('qs')
let obj = {"scope":"smart_business","grant_type":"client_credentials"} let obj = { "scope": "smart_business", "grant_type": "client_credentials" }
// if(settings.env == 'dev'){ // if(settings.env == 'dev'){
// const rs = await axios({ // const rs = await axios({
// method: 'post', // method: 'post',
...@@ -80,7 +93,7 @@ class ExecClient { ...@@ -80,7 +93,7 @@ class ExecClient {
// } // }
// return ret; // return ret;
// } // }
let cmd = this.Fetch360TokenCmd(qs.stringify(obj),url); let cmd = this.Fetch360TokenCmd(qs.stringify(obj), url);
console.log(cmd); console.log(cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
return result; return result;
......
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