Commit 7865fd43 by 陈思聪

feat: 阿里接口支持Post请求

parent 1c4a46c1
......@@ -94,9 +94,19 @@ class TradetransferAPI extends APIBase {
async aliclienttransfer(p, obj) {
console.log("----------------sssssssssssssssssss-------------------------------------------")
console.log(p.actionBody)
console.log(p.method)
if (p.actionBody) {
console.log(p.actionBody)
var rtn = await this.aliclient.reqbyget(p.actionBody)
var rtn = null;
try{
if(p.method == 'POST'){
rtn = await this.aliclient.reqbypost(p.actionBody)
}else{
rtn = await this.aliclient.reqbyget(p.actionBody)
}
}catch (e) {
console.log(e)
}
console.log("after call ali......................................form igirl-channel...")
console.log(rtn)
return rtn;
......
......@@ -48,6 +48,19 @@ class aliyunClient {
});
}
async reqbypost(obj, cbk) {
var self = this;
var action = obj.action;
var reqbody = obj.reqbody;
return self.aliclient.request(action, reqbody, {
timeout: 3000, // default 3000 ms
formatAction: true, // default true, format the action to Action
formatParams: true, // default true, format the parameter name to first letter upper case
method: 'POST', // set the http method, default is GET
headers: {}, // set the http request headers
});
}
// async getCreateOrderNum() {
// var createOrderNum = await this.getUidStr(5, 36);//====================订单号生成
......
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