Commit 7dcea924 by 庄冰

form

parent 8b3c830e
...@@ -10,6 +10,7 @@ class Template extends APIBase { ...@@ -10,6 +10,7 @@ class Template extends APIBase {
this.templateinfoSve = system.getObject("service.template.templateinfoSve"); this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this.templatelinkSve = system.getObject("service.template.templatelinkSve"); this.templatelinkSve = system.getObject("service.template.templatelinkSve");
this.formsubmitrecordSve= system.getObject("service.configmag.formsubmitrecordSve"); this.formsubmitrecordSve= system.getObject("service.configmag.formsubmitrecordSve");
this.forminfoSve= system.getObject("service.configmag.forminfoSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -49,5 +50,9 @@ class Template extends APIBase { ...@@ -49,5 +50,9 @@ class Template extends APIBase {
return opResult; return opResult;
} }
async getFormInfoById(pobj, qobj, req){
let result = await this.forminfoSve.findOne({id:pobj.id},[]);
return system.getResult(result);
}
} }
module.exports = Template; module.exports = Template;
...@@ -53,4 +53,27 @@ module.exports = function (app) { ...@@ -53,4 +53,27 @@ module.exports = function (app) {
res.end(JSON.stringify(r)); res.end(JSON.stringify(r));
}); });
}); });
app.post('/external/:gname/:qname/:method', function (req, res) {
var classPath = req.params["qname"];
var methodName = req.params["method"];
var gname=req.params["gname"];
var params = [];
classPath=gname+"."+classPath;
var tClientIp = System.get_client_ip(req);
req.clientIp = tClientIp;
req.uagent= req.headers["user-agent"];
params.push(gname);
params.push(methodName);
params.push(req.body);
params.push(req.query);
params.push(req);
var p = null;
var invokeObj = System.getObject("api." + classPath);
if (invokeObj["doexec"]) {
p = invokeObj["doexec"].apply(invokeObj, params);
}
p.then(r => {
res.end(JSON.stringify(r));
});
});
}; };
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