Commit 592e7434 by 蒋勇

d

parent c66260a3
......@@ -55,7 +55,7 @@ class APIBase{
this.logClient.log(pobj,req,rtn)
return rtn;
} catch (e) {
this.logClient.log(pobj,req,{})
this.logClient.log(pobj,req,null,e.stack)
console.log(e.stack, "api调用异常--error...................");
var rtnerror = system.getResultFail(-200, "出现异常,请联系管理员");
return rtnerror;
......
......@@ -94,10 +94,10 @@ class CtlBase {
return system.getResultFail(...xarg);
}
var rtn = await this[methodname](pobj, query, req);
this.logClient.log(pobj,req,rtn,null,"center-manger")
this.logClient.log(pobj,req,rtn,null)
return rtn;
} catch (e) {
this.logClient.log(pobj,req,null,e.stack,"center-manger")
this.logClient.log(pobj,req,null,e.stack)
console.log(e.stack, "出现异常,请联系管理员.......");
return system.getResultFail(-200, "出现异常,请联系管理员");
}
......
......@@ -276,7 +276,7 @@ class System {
actionBody: {
opTitle: opTitle || "",// N 操作的业务标题
identifyCode: identifyCode || "brg-center-manage",// Y 操作的业务标识
indexName: "brg-user-center",// Y es索引值,同一个项目用一个值
indexName: settings.logindex,// Y es索引值,同一个项目用一个值
messageBody: params, //日志的描述信息
resultInfo:isLogData? resultInfo:{status:resultInfo.status},//返回信息
errorInfo: errorInfo,//错误信息
......
......@@ -13,11 +13,11 @@ class LogClient {
var u = uuid.replace(/\-/g, "");
return u;
}
async log(pobj, req, rtnok,errinfo,appname) {
rtn.requestId = this.getUUID()
async log(pobj, req, rtninfo,errinfo) {
rtninfo.requestId = this.getUUID()
req.params.param = pobj
//第三个字段应该存公司id
system.execLogs(appname+"_"+req.xctx.codetitle, req.params, pobj.company_id, rtnok, errinfo).then(res => {
system.execLogs(settings.appname+"_"+req.xctx.codetitle, req.params, pobj.company_id+"_", rtninfo, errinfo).then(res => {
if (res && res.status == 1) {
console.log("log.....success")
} else {
......
......@@ -18,6 +18,8 @@ var settings = {
defaultpwd: "gsb2020",
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 80,
logindex:"center_manage",
appname:"center_manage",
kongurl: function () {
if (this.env == "dev") {
var localsettings = require("./localsettings");
......
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