mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-01-18 19:42:49 +08:00
递归删除菜单
This commit is contained in:
parent
663ae670cb
commit
db267e857c
@ -5,10 +5,10 @@
|
||||
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
||||
"name" : "删除",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1665500654624,
|
||||
"updateTime" : 1712806455648,
|
||||
"lock" : "0",
|
||||
"createBy" : null,
|
||||
"updateBy" : "guyi",
|
||||
"updateBy" : null,
|
||||
"path" : "/delete",
|
||||
"method" : "DELETE",
|
||||
"parameters" : [ {
|
||||
@ -141,7 +141,17 @@ for(item in userIds){
|
||||
}
|
||||
SqlCache.delete('permissions:1')
|
||||
|
||||
db.table('sys_role_menu').where().eq("menu_id",id).delete();
|
||||
var result = db.table("sys_menu").logic().where().eq("id",id).delete();
|
||||
let recursionDelete = (list) => {
|
||||
list.forEach(it => {
|
||||
db.table('sys_role_menu').where().eq("menu_id",it.id).delete();
|
||||
db.table("sys_menu").logic().where().eq("id",it.id).delete()
|
||||
let children = db.select("select id from sys_menu where is_del = 0 and pid = #{it.id}")
|
||||
if(children && children.size() > 0){
|
||||
recursionDelete(children)
|
||||
}
|
||||
})
|
||||
}
|
||||
recursionDelete(db.select("select id from sys_menu where is_del = 0 and pid = #{id}"))
|
||||
|
||||
return result
|
||||
db.table('sys_role_menu').where().eq("menu_id",id).delete();
|
||||
return db.table("sys_menu").logic().where().eq("id",id).delete();
|
Loading…
Reference in New Issue
Block a user