Commit 912781ca by linboxuan

icp gateway

parent 31f2f411
...@@ -265,40 +265,68 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -265,40 +265,68 @@ 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 (!rtn || !rtn.stdout) { if (result.status != 0) {
// return { "message": "网络错误", "data": {}, "code": -102 }
return { return {
"requestId": self.getUUID(), "requestId": result.requestId,
"success": false, "success": false,
"errorMsg": "网络错误", "errorMsg": result.msg,
"errorCode": "ok" "errorCode": "ok"
}; };
} }
var result = JSON.parse(rtn.stdout); // 获取userpin
if (result.status == 0) { var userparam = {
// return { "message": "true", "data": {}, "code": 200 } 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 { 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 } // 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 {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "网络错误",
"errorCode": "ok"
};
}
var result = JSON.parse(rtn.stdout);
if (result.status != 0) {
return { return {
"requestId": result.requestId, "requestId": result.requestId,
"success": false, "success": false,
...@@ -306,6 +334,12 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -306,6 +334,12 @@ class UtilsNeedSve extends AppServiceBase {
"errorCode": "ok" "errorCode": "ok"
}; };
} }
return {
"requestId": result.requestId,
"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