Commit 24fe5dd8 by 庄冰

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

parents 1b552297 feb7bf85
...@@ -58,7 +58,7 @@ class TmOrderAPI extends APIBase { ...@@ -58,7 +58,7 @@ class TmOrderAPI extends APIBase {
"tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts", "tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts",
"updateCustomerInfo", "addOrderAndDelivery", "updateOrderPayStatus"].indexOf(action_type) >= 0) { "updateCustomerInfo", "addOrderAndDelivery", "updateOrderPayStatus"].indexOf(action_type) >= 0) {
if (!action_body.channelUserId) { if (!action_body.channelUserId) {
return system.getResult(-99, "verify channelUserId is empty"); return system.getResultFail(-99, "verify channelUserId is empty");
} }
} }
switch (action_type) { switch (action_type) {
......
...@@ -67,19 +67,19 @@ class AccessAuthAPI extends APIBase { ...@@ -67,19 +67,19 @@ class AccessAuthAPI extends APIBase {
case "userPinByLgoin": case "userPinByLgoin":
opResult = await this.opPlatformUtils.getReqUserPinByLgoin(action_body, userpin); opResult = await this.opPlatformUtils.getReqUserPinByLgoin(action_body, userpin);
if (opResult.status == 0) { if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr }) return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr, isAdmin: opResult.data.isAdmin || 0 })
} }
break; break;
case "userPinByLgoinVcode": case "userPinByLgoinVcode":
opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "login"); opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "login");
if (opResult.status == 0) { if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr }) return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr, isAdmin: opResult.data.isAdmin || 0 })
} }
break; break;
case "userPinByRegister": case "userPinByRegister":
opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "reg"); opResult = await this.opPlatformUtils.getReqUserPinByLgoinVcode(action_body, userpin, "reg");
if (opResult.status == 0) { if (opResult.status == 0) {
return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr }) return system.getResultSuccess({ userpin: userpin, channelUserId: encryptStrResult.data, userName: opStr, isAdmin: opResult.data.isAdmin || 0 })
} }
break; break;
case "logout": case "logout":
......
...@@ -34,7 +34,6 @@ class CacheBase { ...@@ -34,7 +34,6 @@ class CacheBase {
this.redisClient.sadd(this.cacheCacheKeyPrefix, [cachekey + "|" + this.desc]); this.redisClient.sadd(this.cacheCacheKeyPrefix, [cachekey + "|" + this.desc]);
return objval; return objval;
} else { } else {
this.redisClient.set(cachekey, cacheValue, ex);
return JSON.parse(cacheValue); return JSON.parse(cacheValue);
} }
} }
......
...@@ -21,6 +21,7 @@ class AppUserDao extends Dao { ...@@ -21,6 +21,7 @@ class AppUserDao extends Dao {
"orgName", "orgName",
"orgPath", "orgPath",
"isEnabled", "isEnabled",
"isAdmin",
"loginNum", "loginNum",
"lastLoginTime"], "lastLoginTime"],
raw: true raw: true
......
...@@ -14,7 +14,8 @@ module.exports = (db, DataTypes) => { ...@@ -14,7 +14,8 @@ module.exports = (db, DataTypes) => {
orgPath : DataTypes.STRING(255), // 组织结构路径 orgPath : DataTypes.STRING(255), // 组织结构路径
isEnabled : DataTypes.INTEGER, // 是否启用 isEnabled : DataTypes.INTEGER, // 是否启用
loginNum : DataTypes.INTEGER, // 登录次数 loginNum : DataTypes.INTEGER, // 登录次数
lastLoginTime : DataTypes.DATE, // 上次登录时间 lastLoginTime : DataTypes.DATE, // 上次登录时间
isAdmin : DataTypes.INTEGER, // 是否管理员
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
underscored: true, underscored: true,
......
...@@ -654,6 +654,10 @@ class OrderTmProductService extends ServiceBase { ...@@ -654,6 +654,10 @@ class OrderTmProductService extends ServiceBase {
var sqlCount = "SELECT count(1) as dataCount FROM `b_order_tm_product` AS tm LEFT JOIN `b_order` AS o ON tm.`sourceOrderNo`=o.`orderNo` LEFT JOIN" + var sqlCount = "SELECT count(1) as dataCount FROM `b_order_tm_product` AS tm LEFT JOIN `b_order` AS o ON tm.`sourceOrderNo`=o.`orderNo` LEFT JOIN" +
" `b_customerinfo` AS c ON tm.`deliveryOrderNo`=c.`deliveryOrderNo` where tm.deleted_at is null "; " `b_customerinfo` AS c ON tm.`deliveryOrderNo`=c.`deliveryOrderNo` where tm.deleted_at is null ";
var paramWhere = {}; var paramWhere = {};
sql += " and tm.app_id=:app_id";
sqlCount += " and tm.app_id=:app_id";
paramWhere.app_id = req.app.id;
if (["1688", "jd", "gsbhome"].indexOf(pobj.actionProcess) >= 0) { if (["1688", "jd", "gsbhome"].indexOf(pobj.actionProcess) >= 0) {
sql += " and o.orderPayStatus=:orderPayStatus"; sql += " and o.orderPayStatus=:orderPayStatus";
sqlCount += " and o.orderPayStatus=:orderPayStatus";; sqlCount += " and o.orderPayStatus=:orderPayStatus";;
...@@ -661,7 +665,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -661,7 +665,7 @@ class OrderTmProductService extends ServiceBase {
} }
if (req.user) { if (req.user) {
if (params.getListType && params.getListType == "getTmOrderListAdmin") { if (params.getListType && params.getListType == "getTmOrderListAdmin") {
if (["syaify", "jd_613f2fd04340f"].indexOf(req.user.channelUserId) < 0) { if (["syaify", "jd_613f2fd04340f"].indexOf(req.user.channelUserId) < 0 && req.user.isAdmin != 1) {
sql += " and tm.createuser_id=:createuser_id"; sql += " and tm.createuser_id=:createuser_id";
sqlCount += " and tm.createuser_id=:createuser_id"; sqlCount += " and tm.createuser_id=:createuser_id";
paramWhere.createuser_id = req.user.id; paramWhere.createuser_id = req.user.id;
......
...@@ -25,10 +25,15 @@ class OpPlatformUtils { ...@@ -25,10 +25,15 @@ class OpPlatformUtils {
async getReqApiAccessKey(appKey, secret) { async getReqApiAccessKey(appKey, secret) {
var cacheManager = system.getObject("db.common.cacheManager"); var cacheManager = system.getObject("db.common.cacheManager");
var reqApiAccessKey = null; var reqApiAccessKey = null;
appKey = appKey && secret ? appKey : settings.appKey;
var cacheValue = await cacheManager["ApiAccessKeyCache"].getCache(appKey);
if (cacheValue && cacheValue.status == 0) {
return cacheValue;
}
if (appKey && secret) { if (appKey && secret) {
reqApiAccessKey = await cacheManager["ApiAccessKeyCache"].cache(appKey, null, 10, secret); reqApiAccessKey = await cacheManager["ApiAccessKeyCache"].cache(appKey, null, 10, secret);
} else { } else {
reqApiAccessKey = await cacheManager["ApiAccessKeyCache"].cache(settings.appKey, null, 10); reqApiAccessKey = await cacheManager["ApiAccessKeyCache"].cache(appKey, null, 10);
} }
if (!reqApiAccessKey || !reqApiAccessKey.data) { if (!reqApiAccessKey || !reqApiAccessKey.data) {
return system.getResult(null, "获取请求token失败"); return system.getResult(null, "获取请求token失败");
......
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