Commit 592e7434 by 蒋勇

d

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