diff --git a/data/magic-api/api/系统管理/菜单管理/删除.ms b/data/magic-api/api/系统管理/菜单管理/删除.ms index 2bf624d..66a82f9 100644 --- a/data/magic-api/api/系统管理/菜单管理/删除.ms +++ b/data/magic-api/api/系统管理/菜单管理/删除.ms @@ -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(); var result = db.table("sys_menu").logic().where().eq("id",id).delete(); -var menuId = id -cacheDelete(); - return result \ No newline at end of file