超管 不需要 关联 接口权限 默认 拥有 所有

This commit is contained in:
2025-12-18 13:52:25 +08:00
parent 16e36961e3
commit ec4fbafd6d

View File

@@ -128,15 +128,15 @@ public class LoadingRole implements CommandLineRunner {
String method1 = menu1.getString("method");
String permission = menu1.getString("permission");
String pid = menu1.getString("pid");
String listSql = "select * from sys_roles_menus where menu_id=? and role_id=?";
List<Row> count1 = Db.selectListBySql(listSql, menuId, 1L);
if (count1.isEmpty()) {
sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
Db.insertBySql(sql, menuId, 1L);
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", title, permission);
}
// String listSql = "select * from sys_roles_menus where menu_id=? and role_id=?";
// List<Row> count1 = Db.selectListBySql(listSql, menuId, 1L);
//
//
// if (count1.isEmpty()) {
// sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
// Db.insertBySql(sql, menuId, 1L);
// log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", title, permission);
// }
if (!title.equals(permissionName) || !fullPath.equals(url) || !httpMethod.equals(method1) || !parentId.equals(pid) || !"3".equals(type)) {
sql = "update sys_menu set title=?,type=?, url=?, method=?, pid=? where menu_id=?";
@@ -153,8 +153,8 @@ public class LoadingRole implements CommandLineRunner {
Row info = Db.selectOneBySql(sql, s);
Long menuId = info.getLong("menu_id");
sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
Db.insertBySql(sql, menuId, 1L);
// sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
// Db.insertBySql(sql, menuId, 1L);
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", s, s);
}