Commit f23b5faa by 宋毅

tj

parent afd5a54f
......@@ -129,7 +129,7 @@ class tmqueryCtl extends CtlBase {
reqParam = self.appInfo["jd"];
break;
case "1688":
reqParam = self.appInfo["jd"];
reqParam = self.appInfo["1688"];
break;
default:
break;
......@@ -252,7 +252,7 @@ class tmqueryCtl extends CtlBase {
}
async getJdUserInfo(pobj, qobj, req) {
try {
this.logClient.error("jd", "getUserInfo--error--->pobj:" + JSON.stringify(pobj));
// this.logClient.info("jd", "getUserInfo--info--->pobj:" + JSON.stringify(pobj));
if (req.session.userPinInfo) {
return system.getResultSuccess({ encryptChannelUserId: req.session.userPinInfo.encryptChannelUserId || "" });
}
......@@ -313,10 +313,10 @@ class tmqueryCtl extends CtlBase {
// '{"success":true,"code":null,"msg":null,"data":{"orderNumber":"6058867","erpOrderId":"523198741458590844",
// "returnUrl":"https://buy.jdcloud.com/pay?orderId=523198741458590844","saasCheckUrl":null}}' }
console.log(tmpResult, "tmpResult...........opPayPageInfo........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$....");
this.logClient.info("jd", "opPayPageInfo--tmpResult-->" + JSON.stringify(tmpResult));
if (tmpResult && tmpResult.result && tmpResult.result == true) {
var payDataResult = JSON.parse(tmpResult.data);
console.log(payDataResult, "payDataResult...........payDataResult........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..002..");
if (payDataResult && payDataResult.success && payDataResult.success == true) {
//更新订单信息
await this.putPayOrderData(pobj, orderResult, payDataResult, req);
......@@ -361,7 +361,6 @@ class tmqueryCtl extends CtlBase {
accessKeyId: 'C6D680733C19362B5DF478207D6A90A4', //替换自己的AK
secretAccessKey: 'EB9AFEE49CE41700CADD5F2EE3B2122C' //替换自己的SK--jd>>>>>>>
}
//测试报文:
//ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
//POST
......@@ -379,7 +378,6 @@ class tmqueryCtl extends CtlBase {
};//这是需要提交的数据
// var tmpContent = '{"pin":"syaify","serviceId":"581976","itemCode":"FW_GOODS-581976","platform":6,"orderNum":1,"articleType":1,"additions":{"246":0}}';
var tmpContent = JSON.stringify(post_data);
var tmpContentLength = Buffer.byteLength(tmpContent);
ctx.body = tmpContent;
......@@ -432,31 +430,10 @@ class tmqueryCtl extends CtlBase {
req.write(tmpContent);
req.end();
});
var tmd = 99;
return reqResult;
// var req = http.request(options, function (res) {
// console.log("statusCode: ", res.statusCode);
// console.log("headers: ", res.headers);
// var _data = '';
// res.on('data', function (chunk) {
// _data += chunk;
// });
// res.on('end', function () {
// console.log("\n--->>\nresult:", _data)
// });
// });
// req.on('error', (e) => {
// console.error(`请求遇到问题-------------: ${e.message}`);
// });
// req.write(tmpContent);
// req.end();
// var tmd = 99;
} catch (errorMsg) {
console.log(errorMsg, "--jd>>>>>>>errorMsg..............................>>>>>>");
return { success: false, code: -200, msg: errorMsg.stack };
this.logClient.error("jd", "req---->getPayPageAddr---->error:" + error.stack);
return { success: false, code: -200, msg: error.stack };
}
}
async pushPayOrder(pushData, req) {//处理京东推送的订单信息
......
......@@ -100,6 +100,42 @@ module.exports = function (app) {
res.redirect("/#/jd/jdindentlist?channelUserId=" + encodeURIComponent(userItemResult.data.encryptChannelUserId));
return;
});
app.get("/1688/selfRegister", async function (req, res) {
var params = {
actionProcess: "1688",
requrl: "/action/tmOrder/springBoard",
actionType: "op1688ChannelPushOrder",
actionBody: req.query
};
params.actionBody.channelItemCode = "1406046";
var result = await tmqueryCtl.doPost(params, null, req);
if (result.status != 0) {
console.log(result, "result.........");
res.end(JSON.stringify(result));
return;
}
var skipUrl = "/#/1688/jdindentlist?channelUserId=" + encodeURIComponent(result.data);
res.redirect(skipUrl);
});
app.get("/1688/auxRegister", async function (req, res) {
var params = {
actionProcess: "1688",
requrl: "/action/tmOrder/springBoard",
actionType: "op1688ChannelPushOrder",
actionBody: req.query
};
params.actionBody.channelItemCode = "3492659";
var result = await tmqueryCtl.doPost(params, null, req);
if (result.status != 0) {
console.log(result, "result.........");
res.end(JSON.stringify(result));
return;
}
var skipUrl = "/#/1688/jdindentlist?channelUserId=" + encodeURIComponent(result.data);
res.redirect(skipUrl);
});
app.get("/", async function (req, res) {
try {
var appinfo = await metaCtl.getAppInfo(req);
......
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