Commit 2ab67635 by 宋毅

去除多余的代码

parent fe1795d0
......@@ -192,13 +192,13 @@ module.exports = SignService;
// };
// //需求
// var obj={
// "intentionBizId": "yiming_test_00088",
// "phone": "18506016666",
// "intentionBizId": "baidu_test_00081",
// "phone": "18506013333",
// "userName": "测试01",
// "description": "测试01描述",
// "area": "上海",
// "consultType": "5"
// };
// task.createSign(obj,"5cdd926122894160o1q1e34us4738v76").then(sign=>{
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(sign=>{
// console.log(sign,"..............Sign");
// });
\ No newline at end of file
......@@ -114,16 +114,7 @@ class UtilsFqAliyunService extends AppServiceBase {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果1->fq->opAliyunClientPost",
});
// typeof element === 'string' || typeof element === 'number'
this.execClientNew.execLogs(`utilsFqAliyunSve-opAliyunClientPost-result:url=${url}`, pobj, "center-channel-opAliyunClientPost", rtn, null);
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因11:" + JSON.stringify(rtn));
}
......@@ -132,56 +123,12 @@ class UtilsFqAliyunService extends AppServiceBase {
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`utilsFqAliyunSve-opAliyunClientPost-error:url=${url}`, pobj, "center-channel-opAliyunClientPost", null, stackStr);
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
}
async opICClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果2->fq->opAliyunClientPost",
});
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因21:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因22:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
}
async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
......@@ -227,7 +174,7 @@ class UtilsFqAliyunService extends AppServiceBase {
"device_token": pobj.actionBody.device_token //设备编号参数
}
pobj.params = icOrderParams;
var result = await this.opICClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
return await this.disposePushResult(pobj, result, "fq->pushOrder2IC->result", this.pushlogFailType.FQ);
}
......
......@@ -38,13 +38,13 @@ class UtilsPushService extends AppServiceBase {
if (interface_list_temp && interface_list_temp.length == 1) {
const element = interface_list_temp[0];
let reflexActionRes = await self.reflexAction(element, opType, pobj, isDelProductInfo);
self.execClientNew.execLogs("pushBusInfo-reflexAction-result:", pobj, "center-channel-reflexAction", reflexActionRes, null);
self.execClientNew.execLogs("utilsPushSve-pushBusInfo-result11:", pobj, "center-channel-reflexAction", reflexActionRes, null);
return reflexActionRes;
} else {
for (let index = 0; index < interface_list_temp.length; index++) {
const element = interface_list_temp[index];
result = await self.reflexAction(element, opType, pobj, isDelProductInfo);
self.execClientNew.execLogs("pushBusInfo-for---reflexAction-result:", pobj, "center-channel-reflexAction", result, null);
self.execClientNew.execLogs("utilsPushSve-pushBusInfo-result22:", pobj, "center-channel-reflexAction", result, null);
}
return result;
}
......
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