Commit cf72ac3d by 宋毅

新接口

parent fe59ce53
...@@ -12,6 +12,19 @@ const settings = require("../../config/settings"); ...@@ -12,6 +12,19 @@ const settings = require("../../config/settings");
module.exports = function (app) { module.exports = function (app) {
//-----------------------新的模式---------web---------开始 //-----------------------新的模式---------web---------开始
//手动获取签名sign方法
app.use('/op/sign/creatSign', async function (req, res) {
if (!req.body.key) {
return res.end({code: -200, message: "缺少加签秘钥key参数"});
}
if (!req.body.obj) {
return res.end({code: -200, message: "缺少obj参数"});
}
let obj = req.body.obj;
let key = req.body.key;
let result = await signSve.createSign(obj, key);
return res.end(JSON.stringify(result));
});
app.use('/tlpay/aliPayNotify', async function (req, res) {//钉钉接入的搁浅 app.use('/tlpay/aliPayNotify', async function (req, res) {//钉钉接入的搁浅
try { try {
var client_ip = system.get_client_ip(req); var client_ip = system.get_client_ip(req);
...@@ -393,22 +406,6 @@ module.exports = function (app) { ...@@ -393,22 +406,6 @@ module.exports = function (app) {
//-----------------------新的模式---------api---------开始 //-----------------------新的模式---------api---------开始
//手动获取签名sign方法
app.use("/op/sign/creatSign", async function (req, res) {
if (!req.body.key) {
res.end({code: -200, message: "缺少加签秘钥key参数"});
return;
}
if (!req.body.obj) {
res.end({code: -200, message: "缺少obj参数"});
return;
}
let obj = req.body.obj;
let key = req.body.key;
let result = await signSve.createSign(obj, key);
res.end(JSON.stringify(result));
return;
});
app.all("/api/*", async function (req, res, next) { app.all("/api/*", async function (req, res, next) {
let result = system.getResult(null, "req method must is post"); let result = system.getResult(null, "req method must is post");
if (req.method != "POST") { if (req.method != "POST") {
......
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