updated menu & del permission
This commit is contained in:
parent
1768d4cbbb
commit
12885adf17
2 changed files with 34 additions and 7 deletions
|
|
@ -142,22 +142,36 @@ export class PermissionController extends Controller {
|
|||
|
||||
const getList = await this.authSysRepo.find({
|
||||
select: ["id", "parentId", "sysName", "sysDescription", "icon", "path", "order"],
|
||||
where: {
|
||||
id: In(sysId),
|
||||
},
|
||||
where: [
|
||||
{
|
||||
id: In(sysId),
|
||||
},
|
||||
{
|
||||
parentId: In(sysId),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
reply = getList
|
||||
reply = await getList
|
||||
.filter((x) => x.parentId == null)
|
||||
.sort((a, b) => a.order - b.order)
|
||||
.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
children: getList
|
||||
.filter((x) => x.parentId == item.id)
|
||||
.sort((a, b) => a.order - b.order),
|
||||
.sort((a, b) => a.order - b.order)
|
||||
.map((item2) => {
|
||||
return {
|
||||
...item2,
|
||||
children: getList
|
||||
.filter((x) => x.parentId == item2.id)
|
||||
.sort((a, b) => a.order - b.order),
|
||||
};
|
||||
}),
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a.order - b.order);
|
||||
});
|
||||
|
||||
redisClient.setex("menu_" + request.user.sub, 86400, JSON.stringify(reply));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue