Commit face37be by 宋毅

tj

parent 28502314
...@@ -53,17 +53,18 @@ class APIBase { ...@@ -53,17 +53,18 @@ class APIBase {
await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600); await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600);
} }
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId }; var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClientNew.execLogs("reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null); this.execClientNew.execLogs("center-channel-doexecMethod-reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
return result; return result;
} catch (e) { } catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员.........."); const stackStr = e.stack ? e.stack : JSON.stringify(e);
console.log(stackStr, "api调用出现异常,请联系管理员..........");
this.logCtl.createDb({ this.logCtl.createDb({
appid: req.app.id, appid: req.app.id,
appkey: req.app.uappKey, appkey: req.app.uappKey,
requestId: req.requestId, requestId: req.requestId,
op: req.classname + "/" + methodname, op: req.classname + "/" + methodname,
content: JSON.stringify(pobj), content: JSON.stringify(pobj),
resultInfo: JSON.stringify(e.stack), resultInfo: stackStr,
clientIp: req.clientIp, clientIp: req.clientIp,
agent: req.uagent, agent: req.uagent,
opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey, opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey,
...@@ -78,8 +79,8 @@ class APIBase { ...@@ -78,8 +79,8 @@ class APIBase {
// agent: req.uagent, // agent: req.uagent,
// optitle: "api调用出现异常,请联系管理员", // optitle: "api调用出现异常,请联系管理员",
// }); // });
this.execClientNew.execLogs("reqPath异常:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null); this.execClientNew.execLogs("center-channel-doexecMethod-reqPath异常:" + req.path, pobj, "center-channel-doexecMethod", null, stackStr);
var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack); var rtnerror = system.getResultFail(-200, "出现异常,error:" + stackStr);
rtnerror.requestId = req.requestId; rtnerror.requestId = req.requestId;
return rtnerror; return rtnerror;
} }
......
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