Commit f95c265c by 宋毅

tj

parent 41318641
......@@ -31,26 +31,28 @@ class APIBase {
async doexecMethod(gname, methodname, pobj, query, req) {
var action = this.userCenterAction[req.body.Action];
if (req.body.Action && action) {
var reqParams = {
actionType: pobj.actionType,
actionBody: null
};
if (pobj.Action && action) {
reqParams.actionType = action;
reqParams.actionBody = pobj;
var userId = req.body["SubAccountUin"] || req.body["Uin"];
req.body.UserId = userId || "100000013569";
req.body.actionType = action;
req.body.actionBody = req.body;
}
var param = {
pobj: pobj,
query: query
reqParams.actionBody.UserId = userId || "100000013569";
} else {
reqParams.actionBody = pobj.actionBody;
}
console.log(JSON.stringify(param),".....base........req...........")
console.log(JSON.stringify(reqParams), "....req......base......");
try {
var result = await this[methodname](pobj, query, req);
var result = await this[methodname](reqParams, query, req);
if (!result) {
result = system.getResult(null, "请求的方法返回值为空");
}
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClient.execLogs("reqPath:" + req.path + "执行结果", param, "brg-user-center-apibase", tmpResult, null);
var tmpResult = reqParams.actionType && reqParams.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClient.execLogs("reqPath:" + req.path + "执行结果", reqParams, "brg-user-center-apibase", tmpResult, null);
result.requestId = result.requestId || uuid.v1();
if (req.body.Action && this.userCenterAction[req.body.Action]) {
if (pobj.Action && action) {
result = await this.handleTxResult(result);
delete req.body["Action"];
}//处理tx返回数据
......@@ -60,8 +62,8 @@ class APIBase {
console.log(stackStr, "api调用出现异常,请联系管理员..........")
var rtnerror = system.getResultFail(-200, "出现异常,error:" + stackStr);
rtnerror.requestId = uuid.v1();
this.execClient.execLogs("reqPath:" + req.path + "执行异常", param, "brg-user-center-apibase", null, stackStr);
if (req.body.Action && this.userCenterAction[req.body.Action]) {
this.execClient.execLogs("reqPath:" + req.path + "执行异常", reqParams, "brg-user-center-apibase", null, stackStr);
if (pobj.Action && action) {
return {
"Response": {
"Status": -200,
......
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