Commit a0138363 by 王栋源

wdy

parent 5841a2f7
......@@ -18,7 +18,7 @@ class UtilsNeedSve extends AppServiceBase {
async getCenterToken() {
var self = this;
var reqTokenUrl = this.centerChannelUrl + "/web/auth/accessAuth/getAppTokenByAppKey";
var reqTokenUrl = this.centerChannelUrl + "/api/auth/accessAuth/getAppTokenByAppKey";
var reqParam = self.appInfo["aliyuntmtransfer"];
if (!reqParam.appkey || !reqParam.secret) {
return system.getResult(null, "reqType类型有误,请求失败");
......@@ -49,6 +49,7 @@ class UtilsNeedSve extends AppServiceBase {
"actionType": pobj.action_type,
"actionBody": pobj
}
var self=this;
var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) {
return {
......@@ -82,7 +83,7 @@ class UtilsNeedSve extends AppServiceBase {
}
}
//带userpin请求
url = settings.centerChannelUrl() + "/web/opreceive/need/springBoard";
url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var token = tokenInfo.data.token;
var rtn = null;
var self = this;
......@@ -96,17 +97,56 @@ class UtilsNeedSve extends AppServiceBase {
return system.getResult(null, "execPost is empty");
}
var result = JSON.parse(rtn.stdout);
return result;
}
async paySuccess(pobj) {
var sobj = {
"actionType": pobj.action_type,
"actionBody": pobj
}
var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
var userpin = "";
if (pobj.mobile) {
//获取用户userpin
var userparam = {
actionType: "getLoginByUserName",
actionBody: {
"channelUserId": pobj.mobile,
"mobile": pobj.mobile,
"userName": pobj.mobile
}
};
// pobj.actionBody.channelUserId = pobj.mobile;//渠道用户id,没有则用手机号
// pobj.actionBody.mobile = pobj.mobile;//用户手机号
var url = settings.centerChannelUrl() + "/web/auth/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
return system.getResultFail(-99, "获取userpin失败");
}
userpin = userpinResultTmp.data.userpin;
if (!userpin) {
return system.getResultFail(-88, "获取userpin失败!!");
}
}
//带userpin请求
url = settings.centerChannelUrl() + "/web/opreceive/need/springBoard";
var token = tokenInfo.data.token;
var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) {
return system.getResult(null, "execPost is empty");
}
var result = JSON.parse(rtn.stdout);
return result;
// var url = settings.centerChannelUrl() + "/web/opreceive/need/springBoard";
// var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
// var self = this;
// return {
// "requestId": self.getUUID(),
// "success": true,
// "errorMsg": "",
// "errorCode": "ok"
// };
}
}
......
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