Commit 85924600 by 庄冰

utilsChannelPartnerSve

parent 90affc71
......@@ -7,6 +7,7 @@ class UtilsChannelPartnerService extends AppServiceBase {
constructor() {
super();
this.opPushQueueUrl = settings.opPushQueueUrl();
this.signSve = system.getObject("service.common.signSve");
}
/**
* 推送业务信息到渠道合作方
......@@ -19,11 +20,12 @@ class UtilsChannelPartnerService extends AppServiceBase {
if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2Channel->verifyResult", this.pushlogFailType.FQ);
}
var actionbody = pobj.actionBody;
var interface_params_info = verifyResult.data;
if(interface_params_info.headData){
if(pobj && pobj.appInfo && pobj.appInfo.app_code){
interface_params_info.headData.appcode = pobj.appInfo.app_code;
}
interface_params_info.headData.appcode = pobj.appInfo.app_code;
interface_params_info.headData.sign = verifyResult.sign;
interface_params_info.headData.appkey = pobj.appInfo.uapp_key;
}
var reqParams = {
actionType: "produceData",// Y 功能名称
......@@ -32,7 +34,7 @@ class UtilsChannelPartnerService extends AppServiceBase {
actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称
notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url
identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识
messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
messageBody: actionbody, // Y 推送的业务消息,必须有一项对象属性值
headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"}
},
requestId: pobj.requestId || "" // N 请求id
......@@ -73,7 +75,17 @@ class UtilsChannelPartnerService extends AppServiceBase {
if (!interface_params_info || !interface_params_info.pushUrl || !interface_params_info.headData) {
verify = system.getResult(null, "interface_params(pushUrl、headData) can not be empty,100430");
}
if(!pobj || !pobj.appInfo || !pobj.appInfo.app_code){
verify = system.getResult(null, "appInfo can not be empty,100450");
}
var signRes = await this.signSve.createSign(pobj.actionBody,pobj.appInfo.uapp_secret);
if(signRes && signRes.status==0){
verify.sign=signRes.data;
}else{
verify = system.getResult(null, "creatSign fail!,100470");
}
verify.data = interface_params_info;
console.log(verify,"app/base/service/impl/utilsSve/utilsChannelPartnerSve.js____verifyParam___________________");
return verify;
}
......
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