Commit b149c3a1 by 宋毅

增加路由

parent 027370fa
......@@ -58,6 +58,10 @@ module.exports = {
"/api/tm/status/notify",
"/api/tm/tmcase/nbtzreceiveAssistTmData",
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
],
apiAliSendKeyPathList: [
"/api/opreceive/pushAliInfo/tmNote",
"/api/opreceive/pushAliInfo/icNote",
]
},
AREACOMM: {
......
......@@ -6,7 +6,7 @@ const utilsFeishuSve = system.getObject("service.utilsSve.utilsFeishuSve");
const signSve = system.getObject("service.common.signSve");
const xml2js = require('xml2js');
const jwt = require('jsonwebtoken');
const { PDICT } = require("../../config/businessConfig");
const {PDICT} = require("../../config/businessConfig");
const settings = require("../../config/settings");
module.exports = function (app) {
......@@ -175,7 +175,11 @@ module.exports = function (app) {
body += data;
});
req.on('end', async function () {
xml2js.parseString(body, { trim: true, explicitArray: false, explicitRoot: false }, async function (err, json) {
xml2js.parseString(body, {
trim: true,
explicitArray: false,
explicitRoot: false
}, async function (err, json) {
var client_ip = system.get_client_ip(req);
var result = await utilsOrderSve.wxPayNotify(json);
logCtl.info({
......@@ -338,7 +342,8 @@ module.exports = function (app) {
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp; req
req.clientIp = tClientIp;
req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
......@@ -411,8 +416,26 @@ module.exports = function (app) {
res.end(JSON.stringify(result));
return;
}
if (PDICT.apiAliSendKeyPathList.indexOf(req.originalUrl) >= 0) {
//验证数据key
var appkey = req.headers["appkey"] || "";
if (!appkey) {
result.msg = "req headers appkey can not be empty";
result.data = null;
res.end(JSON.stringify(result));
return;
}
if (appkey != "201912031344") {
result.msg = "req appkey verify error";
result.data = null;
res.end(JSON.stringify(result));
return;
}
next();
return;
}
if (PDICT.apiSecretPathList.indexOf(req.originalUrl) >= 0) {
//TODO:验证数据签名
//验证数据签名
var appkey = req.headers["appkey"] || "";
if (!appkey) {
result.msg = "req headers appkey can not be empty";
......@@ -551,7 +574,8 @@ module.exports = function (app) {
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp; req
req.clientIp = tClientIp;
req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
......
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