Commit c97dba72 by 蒋勇

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

parents 7535ff74 a8d78fe7
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
class UserCache extends CacheBase{
constructor(){
class UserCache extends CacheBase {
constructor() {
super();
this.userDao=system.getObject("db.auth.userDao");
this.userDao = system.getObject("db.auth.userDao");
}
isdebug(){
return settings.env=="dev";
isdebug() {
return settings.env == "dev";
}
desc(){
desc() {
return "缓存本地应用对象";
}
prefix(){
prefix() {
return "g_userlocal_cm:"
}
async buildCacheVal(cachekey,inputkey, val, ex, ...items) {
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
const configValue = await this.userDao.model.findAll({
where: { userName: inputkey, app_id: settings.pmappid,isEnabled:true},
attributes: ['id','userName', 'nickName','headUrl','jwtkey','jwtsecret','created_at','isSuper','isAdmin','isAllocated','mail','mobile','opath','ptags'],
where: { userName: inputkey, app_id: settings.pmappid, isEnabled: true },
attributes: ['id', 'userName', 'nickName', 'headUrl', 'jwtkey', 'jwtsecret', 'created_at', 'isSuper', 'isAdmin', 'isAllocated', 'mail', 'mobile', 'opath', 'ptags'],
include: [
{ model: this.db.models.company,attributes:['id','name','companykey','appids'],raw:true},
{model:this.db.models.role,as:"Roles",attributes:["id","code"],}
{ model: this.db.models.company, attributes: ['id', 'name', 'companykey', 'appids', "code"], raw: true },
{ model: this.db.models.role, as: "Roles", attributes: ["id", "code"], }
],
});
......@@ -31,4 +31,4 @@ class UserCache extends CacheBase{
return null;
}
}
module.exports=UserCache;
\ No newline at end of file
module.exports = UserCache;
\ No newline at end of file
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