Commit 58ee6a6a by 宋毅

rj

parent 487e1702
......@@ -3,6 +3,9 @@ var system = require("../../base/system");
var metaCtl = system.getObject("web.common.metaCtl");
var tmqueryCtl = system.getObject("web.trademark.tmqueryCtl");
var logClient = system.getObject("util.logClient");
const jwt = require('jsonwebtoken');
const secret = '3rZ3aNfGAyQAB4sE'; //自定义
module.exports = function (app) {
app.get("/jdtm/getUser", async function (req, res) {
try {
......@@ -53,7 +56,7 @@ module.exports = function (app) {
clientIp: ""
});
req.query.actionProcess = "jd";
var result = await tmqueryCtl.pushPayOrder(req.query, req);
var result = await tmqueryCtl.pushJdPayOrder(req.query, req);
logClient.payLog("jd", {
optitle: "###操作订单结果...orderNotify",
op: "/jd/orderNotify",
......@@ -154,6 +157,37 @@ module.exports = function (app) {
res.redirect(skipUrl);
});
app.get("/gsb/selfRegister", async function (req, res) {
var skipUrl = "/#/gsb/selftmreg?channelUserId=";
var token = req.cookies.ic_token;
if (!token) {
res.redirect(skipUrl);
return;
}
var userInfo = jwt.verify(token, secret, function (err, decoded) {
if (err) {
return system.getResult(null, "验证token失败");
}
else {
return system.getResultSuccess(decoded);
}
});
if (userInfo.status != 0) {
res.redirect(skipUrl);
return;
}
var getUserparams = {
actionProcess: "gsb",
channelUserId: userInfo.data.phone + "_" + userInfo.data.id
};
var userItemResult = await tmqueryCtl.getUserIdEncryptStr(getUserparams, req.query, req);
if (userItemResult.status != 0) {
res.redirect(skipUrl);
return;
}
skipUrl = skipUrl + encodeURIComponent(userItemResult.data.encryptChannelUserId);
res.redirect(skipUrl);
});
app.get("/", async function (req, res) {
try {
var appinfo = await metaCtl.getAppInfo(req);
......
......@@ -36,6 +36,7 @@
"gulp-sass": "^4.0.2",
"http-proxy-middleware": "^0.20.0",
"jdcloud-sdk-signer": "^2.0.1",
"jsonwebtoken": "^8.5.1",
"log4js": "^6.1.0",
"method-override": "^2.3.10",
"morgan": "^1.9.0",
......
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