Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
c97dba72
Commit
c97dba72
authored
Jul 20, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage
parents
7535ff74
a8d78fe7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
center-manage/app/base/db/cache/userCache.js
+14
-14
No files found.
center-manage/app/base/db/cache/userCache.js
View file @
c97dba72
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment