Commit 912781ca by linboxuan

icp gateway

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