Commit da7749e2 by 宋毅

tj

parent 513a46cd
......@@ -8,6 +8,7 @@ class APIBase {
this.cacheManager = system.getObject("db.common.cacheManager");
this.logCtl = system.getObject("web.common.oplogCtl");
this.oplogSve = system.getObject("service.common.oplogSve");
this.toolSve = system.getObject("service.trademark.toolSve");
this.exTime = 2 * 3600;//缓存过期时间,2小时
}
getUUID() {
......@@ -93,7 +94,7 @@ class APIBase {
// return system.getResultFail(system.signFail, signResult.msg);
// }
if (pobj.isUser && pobj.isUser == "yes") {
var channelUserId = pobj.actionBody.channelUserId || "";
var channelUserId = pobj.channelUserId ? pobj.channelUserId : pobj.actionBody.channelUserId || "";
if (!channelUserId && pobj.actionBody.channelUser) {
channelUserId = pobj.actionBody.channelUser.channelUserId;
}
......@@ -121,12 +122,28 @@ class APIBase {
req.headers["request-id"] = requestid;
}
try {
if (methodname == "createChannelUser") {
if (!pobj.isUser) {
system.getResult(null, "isUser is not empty");
}
if (pobj.isUser != "yes") {
system.getResult(null, "isUser value must yes");
}
}
//验证accesskey或验签
var isPassResult = await this.checkAcck(gname, methodname, pobj, query, req);
if (isPassResult.status != 0) {
isPassResult.requestId = "";
return isPassResult;
}
if (methodname == "createChannelUser") {
var encryptResult = await this.toolSve.encryptStr(req.app, req.user.channelUserId);
if (encryptResult.status != 0) {
system.getResult(null, "encrypt channelUserId is error");
}
req.user.encryptChannelUserId = encryptResult.data;
return system.getResultSuccess(req.user);
}//创建用户
req.requestId = requestid;
var rtn = await this[methodname](pobj, query, req);
if (rtn && !rtn.requestId) {
......
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