mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-01-31 17:12:49 +08:00
菜单删除 删除缓存
This commit is contained in:
parent
0b38771d30
commit
f1af10d727
@ -130,12 +130,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
import '@get:/system/menu/cache/delete' as cacheDelete;
|
import org.ssssssss.magicapi.modules.db.cache.SqlCache
|
||||||
|
var userIds = db.select("""
|
||||||
|
select user_id from sys_user_role where role_id in (
|
||||||
|
select role_id from sys_role_menu where menu_id = #{id}
|
||||||
|
) and user_id is not null
|
||||||
|
""")
|
||||||
|
for(item in userIds){
|
||||||
|
SqlCache.delete(`permissions:${item.userId}`)
|
||||||
|
}
|
||||||
|
SqlCache.delete('permissions:1')
|
||||||
|
|
||||||
db.table('sys_role_menu').where().eq("menu_id",id).delete();
|
db.table('sys_role_menu').where().eq("menu_id",id).delete();
|
||||||
var result = db.table("sys_menu").logic().where().eq("id",id).delete();
|
var result = db.table("sys_menu").logic().where().eq("id",id).delete();
|
||||||
|
|
||||||
var menuId = id
|
|
||||||
cacheDelete();
|
|
||||||
|
|
||||||
return result
|
return result
|
Loading…
Reference in New Issue
Block a user