Commit 912781ca by linboxuan

icp gateway

parent 31f2f411
......@@ -265,22 +265,59 @@ class UtilsNeedSve extends AppServiceBase {
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": true,
"success": false,
"errorMsg": "",
"errorCode": "ok"
};
}
var userpin = "";
// 引用属性,channel依赖bizId order依赖intentionBizId
pobj.intentionBizId = pobj.bizId
var sobj = {
"actionType": "getItemByChannelSolutionNo",
"actionBody": pobj
}
//带userpin请求
// getItemByChannelSolutionNo
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var token = tokenInfo.data.token;
var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0) {
return {
"requestId": result.requestId,
"success": false,
"errorMsg": result.msg,
"errorCode": "ok"
};
}
// 获取userpin
var userparam = {
actionType: "getLoginByUserName",
actionBody: {
"channelUserId": result.data.channelUserId,
"mobile": result.data.publishMobile,
"userName": result.data.publishMobile
}
};
var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0) {
return {
"requestId": result.requestId,
"success": false,
"errorMsg": result.msg,
"errorCode": "ok"
};
}
// icpNotify
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
pobj.publishMobile = result.data.publishMobile;
pobj.channelNeedNo = result.data.channelNeedNo;
pobj.needNo = result.data.needNo;
var sobj = {
"actionType": "icpNotify",
"actionBody": pobj
}
var result = await this.execlient.execDataPostByTokenUserPin(sobj, url, token,userpinResultTmp.data.userpin);
if (!rtn || !rtn.stdout) {
// return { "message": "网络错误", "data": {}, "code": -102 }
return {
"requestId": self.getUUID(),
"success": false,
......@@ -289,24 +326,21 @@ class UtilsNeedSve extends AppServiceBase {
};
}
var result = JSON.parse(rtn.stdout);
if (result.status == 0) {
// return { "message": "true", "data": {}, "code": 200 }
if (result.status != 0) {
return {
"requestId": result.requestId,
"success": true,
"errorMsg": "",
"success": false,
"errorMsg": result.msg,
"errorCode": "ok"
};
} else {
// return { "message": result.msg, "data": {}, "code": -102 }
}
return {
"requestId": result.requestId,
"success": false,
"errorMsg": result.msg,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
}
}
module.exports = UtilsNeedSve;
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