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
9f92b786
Commit
9f92b786
authored
Jun 22, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
1c4570eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
center-manage/app/base/service/impl/common/companySve.js
+6
-2
center-manage/app/base/test.js
+3
-0
No files found.
center-manage/app/base/service/impl/common/companySve.js
View file @
9f92b786
...
...
@@ -42,18 +42,22 @@ class CompanyService extends ServiceBase {
let
curNodeData
=
p
.
curdata
if
(
curNodeData
&&
curNodeData
.
isPosition
){
let
opathstr
=
curNodeData
.
orgpath
let
us
=
await
self
.
db
.
models
.
user
.
findAll
({
where
:{
opath
:
opathstr
},
transaction
:
t
})
let
us
=
await
self
.
db
.
models
.
user
.
findAll
({
where
:{
opath
:
{[
self
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
}
},
transaction
:
t
})
//查询出角色
let
roleids
=
curNodeData
.
roles
let
rs
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
roleids
},
app_id
:
p
.
app_id
,
company_id
:
p
.
company_id
},
transaction
:
t
})
// let rs=await self.db.models.role.findAll({where:{id:{[self.db.Op.in]:roleids},app_id:p.app_id,company_id:p.company_id},transaction:t})
let
rs
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
roleids
},
company_id
:
p
.
company_id
},
transaction
:
t
})
for
(
let
u
of
us
){
await
u
.
setRoles
(
rs
,{
transaction
:
t
})
//令用户缓存失效
await
self
.
cacheManager
[
"UserCache"
].
invalidate
(
u
.
userName
)
}
// users.forEach((u)=>{
// await u.setRoles(rs, { transaction: t });
// })
}
//用户缓存也要失效
//缓存失效
await
self
.
cacheManager
[
"CompanyCache"
].
invalidate
(
cmk
)
let
companytmp
=
await
self
.
dao
.
model
.
findOne
({
where
:{
companykey
:
cmk
},
transaction
:
t
});
...
...
center-manage/app/base/test.js
View file @
9f92b786
...
...
@@ -28,3 +28,6 @@ for(let i=0;i<rows.length;i++){
}
}
console
.
log
(
mid
)
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