Commit 35d3ffe9 by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents ff729475 5404d891
...@@ -4,6 +4,7 @@ const uuidv4 = require('uuid/v4'); ...@@ -4,6 +4,7 @@ const uuidv4 = require('uuid/v4');
const md5 = require("MD5"); const md5 = require("MD5");
class WEBBase { class WEBBase {
constructor() { constructor() {
this.execClientNew = system.getObject("util.execClientNew");
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.execClientNew = system.getObject("util.execClientNew"); this.execClientNew = system.getObject("util.execClientNew");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
...@@ -21,20 +22,24 @@ class WEBBase { ...@@ -21,20 +22,24 @@ class WEBBase {
async doexecMethod(gname, methodname, pobj, query, req) { async doexecMethod(gname, methodname, pobj, query, req) {
req.requestId = this.getUUID(); req.requestId = this.getUUID();
try { try {
var rtn = 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,
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(rtn), resultInfo: JSON.stringify(result),
clientIp: req.clientIp, clientIp: req.clientIp,
agent: req.uagent, agent: req.uagent,
opTitle: "api服务提供方appKey:" + settings.appKey, opTitle: "api服务提供方appKey:" + settings.appKey,
}); });
rtn.requestId = req.requestId; var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
return rtn; this.execClientNew.execLogs("reqPath:" + req.path, pobj, "center-channel-doexecMethod-web", tmpResult, null);
return result;
} catch (e) { } catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........") console.log(e.stack, "api调用出现异常,请联系管理员..........")
this.logCtl.createDb({ this.logCtl.createDb({
......
...@@ -268,16 +268,16 @@ class UtilsAuthService extends AppServiceBase { ...@@ -268,16 +268,16 @@ class UtilsAuthService extends AppServiceBase {
let result = await this.get360Token(); let result = await this.get360Token();
let token = result.access_token; let token = result.access_token;
//360验证接口 //360验证接口
// let subData = "pin=" + pin + "&token=" + token; let subData = "pin=" + pin + "&token=" + token;
// let url = settings.requestUrl360() + 'api/v1/VerifyPin'; let url = settings.requestUrl360() + 'api/v1/VerifyPin';
// let rtn = await this.restClient.execGet(subData,url); let rtn = await this.restClient.execGet(subData,url);
// if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
// return system.getResult(null, "restGet data is empty"); return system.getResult(null, "restGet data is empty");
// } }
// let checkRet = JSON.parse(rtn.stdout); let checkRet = JSON.parse(rtn.stdout);
// if(checkRet.code != 200){ if(checkRet.code != 200){
// return system.getResultFail(-1,checkRet.msg) return system.getResultFail(-1,checkRet.msg)
// } }
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin //---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
actionBody.channelUserId = pin; actionBody.channelUserId = pin;
opResult = await this.getLoginByUserName(req,pobj, actionBody); opResult = await this.getLoginByUserName(req,pobj, actionBody);
......
...@@ -92,6 +92,7 @@ class ExecClientNew { ...@@ -92,6 +92,7 @@ class ExecClientNew {
this.execLogs(execFile + "执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果", params, params.identifyCode, reqResult, rtn); this.execLogs(execFile + "执行execPostTimeOutByBusiness,errorInfo信息为请求的返回结果", params, params.identifyCode, reqResult, rtn);
return reqResult; return reqResult;
} catch (error) { } catch (error) {
console.log("执行execPostByTimeOut存在异常", error.stack);
reqResult = system.getResultFail(-200, execFile + "执行execPostByTimeOut存在异常"); reqResult = system.getResultFail(-200, execFile + "执行execPostByTimeOut存在异常");
reqResult.requestId = requestId || uuid.v1(); reqResult.requestId = requestId || uuid.v1();
this.execLogs(execFile + "执行execPostByTimeOut存在异常", params, params.identifyCode, reqResult, error.stack); this.execLogs(execFile + "执行execPostByTimeOut存在异常", params, params.identifyCode, reqResult, error.stack);
......
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