Commit a771d3bb by 宋毅

tj

parent 295be8e8
...@@ -33,6 +33,9 @@ class APIBase { ...@@ -33,6 +33,9 @@ class APIBase {
return JSON.parse(cacheRes); return JSON.parse(cacheRes);
} }
var result = await this[methodname](pobj, query, req); var result = await this[methodname](pobj, query, req);
if (!result.requestId) {
result.requestId = pobj.RequestId ? pobj.RequestId : pobj.requestId || req.requestId;
}
this.logCtl.createDb({ this.logCtl.createDb({
appid: req.app.id, appid: req.app.id,
appkey: req.app.uappKey, appkey: req.app.uappKey,
...@@ -44,12 +47,10 @@ class APIBase { ...@@ -44,12 +47,10 @@ class APIBase {
agent: req.uagent, agent: req.uagent,
opTitle: "api服务提供方appKey:" + settings.appKey, opTitle: "api服务提供方appKey:" + settings.appKey,
}); });
result.requestId = req.requestId;
if (this.cacheMethodList.indexOf(methodname) >= 0 && result.status && result.status == 0) { if (this.cacheMethodList.indexOf(methodname) >= 0 && result.status && result.status == 0) {
//保存缓存 //保存缓存
await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600); await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600);
} }
result.requestId = pobj.RequestId ? pobj.RequestId : pobj.requestId || req.requestId;
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("reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
return result; return result;
......
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