Commit b149c3a1 by 宋毅

增加路由

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