Commit c5ffeb4c by 宋毅

tj

parent 51b239a9
...@@ -16,7 +16,7 @@ class AppUserPinByLoginVcodeCache extends CacheBase { ...@@ -16,7 +16,7 @@ class AppUserPinByLoginVcodeCache extends CacheBase {
async buildCacheVal(cachekey, inputkey, val, ex, ...items) { async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
let actionBody = val.actionBody; let actionBody = val.actionBody;
let appInfo = val.appInfo; let appInfo = val.appInfo;
let userInfo = await this.appuserDao.getItemByChannelUserId(actionBody.mobile, appInfo.uapp_id); let userInfo = await this.appuserDao.getItemByMobile(actionBody.mobile, appInfo.uapp_id);
if (userInfo) { if (userInfo) {
if (userInfo.is_enabled != 1) { if (userInfo.is_enabled != 1) {
return system.getResult(null, "用户未启用"); return system.getResult(null, "用户未启用");
......
...@@ -4,6 +4,11 @@ class AppuserDao extends Dao { ...@@ -4,6 +4,11 @@ class AppuserDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(AppuserDao)); super(Dao.getModelName(AppuserDao));
} }
/**
* 通过渠道用户唯一码进行登录
* @param {*} channel_userid
* @param {*} uapp_id
*/
async getItemByChannelUserId(channel_userid, uapp_id) { async getItemByChannelUserId(channel_userid, uapp_id) {
return this.model.findOne({ return this.model.findOne({
where: { where: {
...@@ -57,5 +62,33 @@ class AppuserDao extends Dao { ...@@ -57,5 +62,33 @@ class AppuserDao extends Dao {
raw: true raw: true
}); });
} }
/**
* 通过用户手机号进行登录
* @param {*} mobile
* @param {*} uapp_id
*/
async getItemByMobile(mobile, uapp_id) {
return this.model.findOne({
where: {
mobile: mobile,
uapp_id: uapp_id
},
attributes: ["id",
"uapp_id",
"channel_userid",
"channel_username",
"channel_nickname",
"open_id",
"head_url",
"mobile",
"org_name",
"org_path",
"email",
"is_admin",
"is_super",
"is_enabled"],
raw: true
});
}
} }
module.exports = AppuserDao; module.exports = AppuserDao;
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