Commit d8ec4b52 by 宋毅

tj

parent 9f3046a1
...@@ -555,46 +555,32 @@ class tmqueryCtl extends CtlBase { ...@@ -555,46 +555,32 @@ class tmqueryCtl extends CtlBase {
} }
async pushGsbPayOrder(pushData, req) {//处理公司宝推送的订单信息 async pushGsbPayOrder(pushData, req) {//处理公司宝推送的订单信息
try { try {
var signResult = await this.createSign(pushData, "6B876EB84731E166D76E1F73AD5764BA", true); var signResult = await this.createSign(pushData, "a7bbb13627cd11ea98c800163e06da98", true);
if (signResult.status != 0) { if (signResult.status != 0) {
return signResult; return signResult;
} }
if (signResult.data != pushData.token.toUpperCase()) { if (!pushData.sign) {
return system.getResult(null, "sign is empty");
}
if (signResult.data != pushData.sign.toUpperCase()) {
return system.getResult(null, "签名错误"); return system.getResult(null, "签名错误");
} }
var tokenInfo = await this.getToken(pushData.actionProcess); var tokenInfo = await this.getToken(pushData.actionProcess);
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return tokenInfo; return tokenInfo;
} }
var param = {}; var param = {
if (pushData.skuId == "FW_GOODS-582064-1") {
param = {
actionProcess: pushData.actionProcess, actionProcess: pushData.actionProcess,
actionType: "updateOrderPayStatus", actionType: "updateOrderPayStatus",
actionBody: { actionBody: {
channelUserId: pushData.jdPin, channelUserId: pushData.user_phone + "_" + pushData.user_id,
payStatus: "yfk", payStatus: "yfk",
channelItemCode: pushData.serviceCode, needNo: "zzsbzc_" + pushData.order_no,
needNoOrderNo: pushData.orderId, needNoOrderNo: pushData.order_no,//---用此字段查找
buyerMoblie: pushData.mobile
},
isUser: "yes"
};
}//自助注册产品
else {
//有返回用户信息进行用户ID加密
param = {
actionProcess: pushData.actionProcess,
actionType: "addOrderAndDelivery",
actionBody: {
channelUserId: pushData.jdPin,
needNo: pushData.skuId + "_" + pushData.orderId,
needNoOrderNo: pushData.orderId,
buyerMoblie: pushData.mobile buyerMoblie: pushData.mobile
}, },
isUser: "yes" isUser: "yes"
}; };
}//商标注册【专家辅助申请】、商标注册【担保申请】和 除商标之外的产品
var reqUrl = this.channelApiUrl + "/action/tmOrder/springBoard"; var reqUrl = this.channelApiUrl + "/action/tmOrder/springBoard";
var resultUser = await this.execClient.execPostTK(param, reqUrl, tokenInfo.data.token); var resultUser = await this.execClient.execPostTK(param, reqUrl, tokenInfo.data.token);
if (!resultUser) { if (!resultUser) {
......
const system=require("../system"); const system=require("../system");
class SmsClient{ class SmsClient{
constructor(){ constructor(){
this.smsTeml="http://123.57.156.109:4103/api/Send"; this.smsTeml="http://123.67.186.109:4103/api/Send";
this.restClient=system.getObject("util.restClient"); this.restClient=system.getObject("util.restClient");
} }
async sendMsg(to,content){ async sendMsg(to,content){
......
...@@ -8,6 +8,7 @@ const jwt = require('jsonwebtoken'); ...@@ -8,6 +8,7 @@ const jwt = require('jsonwebtoken');
const secret = '3rZ3aNfGAyQAB4sE'; //自定义 const secret = '3rZ3aNfGAyQAB4sE'; //自定义
module.exports = function (app) { module.exports = function (app) {
app.get("/admin", async function (req, res) { app.get("/admin", async function (req, res) {
console.log("jd==================================admin==============================================================================================");
res.redirect("https://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=https://tm.plus.jdcloud.com/jdtm/getUser&state=OAjdlist&client_id=9491577327154697"); res.redirect("https://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=https://tm.plus.jdcloud.com/jdtm/getUser&state=OAjdlist&client_id=9491577327154697");
return; return;
...@@ -204,31 +205,29 @@ module.exports = function (app) { ...@@ -204,31 +205,29 @@ module.exports = function (app) {
res.redirect(skipUrl); res.redirect(skipUrl);
}); });
app.get("/gsbhome/orderNotify", async function (req, res) { app.get("/gsbhome/orderNotify", async function (req, res) {
logClient.payLog("jd", { // logClient.payLog("jd", {
optitle: "###操作订单结果参数...orderNotify", // optitle: "###操作订单结果参数...orderNotify",
op: "/jd/orderNotify", // op: "/jd/orderNotify",
content: "req.query=" + JSON.stringify(req.query) + ",req.body=" + JSON.stringify(req.body), // content: "req.query=" + JSON.stringify(req.query) + ",req.body=" + JSON.stringify(req.body),
clientIp: "" // clientIp: ""
}); // });
req.query.actionProcess = "jd"; req.query.actionProcess = "gsbhome";
var result = await tmqueryCtl.pushJdPayOrder(req.query, req); var result = await tmqueryCtl.pushGsbPayOrder(req.query, req);
logClient.payLog("jd", { // logClient.payLog("jd", {
optitle: "###操作订单结果...orderNotify", // optitle: "###操作订单结果...orderNotify",
op: "/jd/orderNotify", // op: "/jd/orderNotify",
content: "result=" + JSON.stringify(result), // content: "result=" + JSON.stringify(result),
clientIp: "" // clientIp: ""
}); // });
if (result.status != 0) { if (result.status != 0) {
res.end(JSON.stringify(result)); res.end(JSON.stringify(result));
return; return;
} }
var params = var params =
{ {
instanceId: req.query.orderBizId, order_no: req.query.order_no,
appInfo: { success: true,
authUrl: "https://tm.plus.jdcloud.com/jd/skipPage?channelUserId=" + req.query.jdPin, auth_url: "https://zcchannelweb.gongsibao.com/gsbhome?state=jdindentlist"
adminUrl: "https://tm.plus.jdcloud.com"
}
}; };
res.end(JSON.stringify(params)); res.end(JSON.stringify(params));
return; return;
......
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