Commit b41048ba by Sxy

fix: 路径映射

parent 38860c4f
...@@ -24,7 +24,7 @@ module.exports = function (app) { ...@@ -24,7 +24,7 @@ module.exports = function (app) {
if (!channel) { if (!channel) {
next() next()
} else { } else {
let rtn = await chnelapi.channelHandle(channel, req.path + "/" + req.body.actionType, req.body) let rtn = await chnelapi.channelHandle(channel, req.path + "/" + ((req.body && req.body.actionType) || ''), req.body)
if (rtn != null) { if (rtn != null) {
res.end(JSON.stringify(rtn)); res.end(JSON.stringify(rtn));
} else { } else {
...@@ -36,11 +36,11 @@ module.exports = function (app) { ...@@ -36,11 +36,11 @@ module.exports = function (app) {
res.end(JSON.stringify({ status: -1, message: e })); res.end(JSON.stringify({ status: -1, message: e }));
} }
}) })
app.post("/login/getpiccode", async (req, res, next) => { app.post("/login/getpiccode", async (req, res, next) => {
let captchaSve = System.getObject("service.auth.captchaSve"); let captchaSve = System.getObject("service.auth.captchaSve");
let data = await captchaSve.apiGenerate({}) let data = await captchaSve.apiGenerate({})
res.end(JSON.stringify(data)); res.end(JSON.stringify(data));
}); });
app.get('/api/:gname/:qname/:method', function (req, res) { app.get('/api/:gname/:qname/:method', function (req, res) {
// var classPath = req.params["qname"]; // var classPath = req.params["qname"];
var methodName = req.params["method"]; var methodName = req.params["method"];
......
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