Commit da904660 by 蒋勇

d

parent fd658481
...@@ -55,7 +55,7 @@ class CtlBase { ...@@ -55,7 +55,7 @@ class CtlBase {
credid: req.headers["x-credential-identifier"], credid: req.headers["x-credential-identifier"],
regrole:req.headers["xregrole"], regrole:req.headers["xregrole"],
bizpath:req.headers["xbizpath"], bizpath:req.headers["xbizpath"],
codetitle:req.headers["xcodename"], codename:req.headers["xcodename"],
codetitle:req.headers["xcodetitle"]?decodeURI(req.headers["xcodetitle"]):'', codetitle:req.headers["xcodetitle"]?decodeURI(req.headers["xcodetitle"]):'',
} }
if(!req.xctx.appkey){ if(!req.xctx.appkey){
...@@ -103,31 +103,31 @@ class CtlBase { ...@@ -103,31 +103,31 @@ class CtlBase {
// } // }
//req.session=redis缓存的上下文对象 //req.session=redis缓存的上下文对象
var rtn = await this[methodname](pobj, query, req); var rtn = await this[methodname](pobj, query, req);
// rtn.requestId=this.getUUID() rtn.requestId=this.getUUID()
// req.params.param=pobj req.params.param=pobj
// system.execLogs(req.xctx.codetitle,req.params,null,rtn,null).then(res=>{ system.execLogs(req.xctx.codetitle,req.params,req.xctx.codename,rtn,null).then(res=>{
// if(res && res.status==1){ if(res && res.status==1){
// console.log("log.....success") console.log("log.....success")
// }else{ }else{
// console.log("log.....fail") console.log("log.....fail")
// } }
// }).catch(e=>{ }).catch(e=>{
// console.log("log.....fail") console.log("log.....fail")
// }) })
return rtn; return rtn;
} catch (e) { } catch (e) {
let rtn={} let rtn={}
// rtn.requestId=this.getUUID() rtn.requestId=this.getUUID()
// req.params.param=pobj req.params.param=pobj
// system.execLogs(req.xctx.codetitle,req.params,null,rtn,e).then(res=>{ system.execLogs(req.xctx.codetitle,req.params,null,rtn,e).then(res=>{
// if(res && res.status==1){ if(res && res.status==1){
// console.log("log.....success") console.log("log.....success")
// }else{ }else{
// console.log("log.....fail") console.log("log.....fail")
// } }
// }).catch(e=>{ }).catch(e=>{
// console.log("log.....fail") console.log("log.....fail")
// }) })
console.log(e.stack, "出现异常,请联系管理员......."); console.log(e.stack, "出现异常,请联系管理员.......");
return system.getResultFail(-200, "出现异常,请联系管理员"); return system.getResultFail(-200, "出现异常,请联系管理员");
} }
......
...@@ -23,8 +23,8 @@ class System { ...@@ -23,8 +23,8 @@ class System {
url: url, url: url,
qs: qdata qs: qdata
}, function (error, response, body) { }, function (error, response, body) {
rtn.statusCode = response.statusCode
if (!error) { if (!error) {
rtn.statusCode = response.statusCode
if (body) { if (body) {
let data = JSON.parse(body) let data = JSON.parse(body)
rtn.data = data rtn.data = data
...@@ -47,8 +47,8 @@ class System { ...@@ -47,8 +47,8 @@ class System {
json: true, json: true,
qs: qdata qs: qdata
}, function (error, response, body) { }, function (error, response, body) {
rtn.statusCode = response.statusCode;
if (!error) { if (!error) {
rtn.statusCode = response.statusCode;
if (body) { if (body) {
rtn.data = body rtn.data = body
} else { } else {
...@@ -75,8 +75,8 @@ class System { ...@@ -75,8 +75,8 @@ class System {
body: data body: data
}, function (error, response, body) { }, function (error, response, body) {
console.log(error) console.log(error)
rtn.statusCode = response.statusCode
if (!error) { if (!error) {
rtn.statusCode = response.statusCode
if (body) { if (body) {
rtn.data = body rtn.data = body
} else { } else {
......
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