超管 不需要 关联 接口权限 默认 拥有 所有
This commit is contained in:
@@ -128,15 +128,15 @@ public class LoadingRole implements CommandLineRunner {
|
|||||||
String method1 = menu1.getString("method");
|
String method1 = menu1.getString("method");
|
||||||
String permission = menu1.getString("permission");
|
String permission = menu1.getString("permission");
|
||||||
String pid = menu1.getString("pid");
|
String pid = menu1.getString("pid");
|
||||||
String listSql = "select * from sys_roles_menus where menu_id=? and role_id=?";
|
// String listSql = "select * from sys_roles_menus where menu_id=? and role_id=?";
|
||||||
List<Row> count1 = Db.selectListBySql(listSql, menuId, 1L);
|
// List<Row> count1 = Db.selectListBySql(listSql, menuId, 1L);
|
||||||
|
//
|
||||||
|
//
|
||||||
if (count1.isEmpty()) {
|
// if (count1.isEmpty()) {
|
||||||
sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
|
// sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
|
||||||
Db.insertBySql(sql, menuId, 1L);
|
// Db.insertBySql(sql, menuId, 1L);
|
||||||
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", title, permission);
|
// log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", title, permission);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!title.equals(permissionName) || !fullPath.equals(url) || !httpMethod.equals(method1) || !parentId.equals(pid) || !"3".equals(type)) {
|
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=?";
|
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);
|
Row info = Db.selectOneBySql(sql, s);
|
||||||
Long menuId = info.getLong("menu_id");
|
Long menuId = info.getLong("menu_id");
|
||||||
|
|
||||||
sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
|
// sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
|
||||||
Db.insertBySql(sql, menuId, 1L);
|
// Db.insertBySql(sql, menuId, 1L);
|
||||||
|
|
||||||
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", s, s);
|
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", s, s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user