Skip to content

Commit

Permalink
fix 权限菜单动态添加租户条件
Browse files Browse the repository at this point in the history
  • Loading branch information
lltx authored Jul 16, 2024
1 parent 81103ac commit ae3cf30
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions common/权限菜单.sql
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , 默认租户 1
-- 该脚本不要直接执行, 注意维护菜单的父节点ID 默认 父节点-1 , #if(!$opensource)默认租户 1#end
#set($menuId=${dateTool.getSystemTime()})

-- 菜单SQL
insert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${menuId}, '-1', '/${moduleName}/${functionName}/index', '', '0', 'icon-bangzhushouji', '0', null , '8', null , '${tableComment}管理', 1);
insert into sys_menu ( menu_id,parent_id, path, permission, menu_type, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${menuId}, '-1', '/${moduleName}/${functionName}/index', '', '0', 'icon-bangzhushouji', '0', null , '8', null , '${tableComment}管理'#if(!$opensource), 1#end);

-- 菜单对应按钮SQL
insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${math.add($menuId,1)},${menuId}, '${moduleName}_${functionName}_view', '1', null, '1', '0', null, '0', null, '${tableComment}查看', 1);
insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${math.add($menuId,1)},${menuId}, '${moduleName}_${functionName}_view', '1', null, '1', '0', null, '0', null, '${tableComment}查看'#if(!$opensource), 1#end);

insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${math.add($menuId,2)},${menuId}, '${moduleName}_${functionName}_add', '1', null, '1', '0', null, '1', null, '${tableComment}新增', 1);
insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${math.add($menuId,2)},${menuId}, '${moduleName}_${functionName}_add', '1', null, '1', '0', null, '1', null, '${tableComment}新增'#if(!$opensource), 1#end);

insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${math.add($menuId,3)},${menuId}, '${moduleName}_${functionName}_edit', '1', null, '1', '0', null, '2', null, '${tableComment}修改', 1);
insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${math.add($menuId,3)},${menuId}, '${moduleName}_${functionName}_edit', '1', null, '1', '0', null, '2', null, '${tableComment}修改'#if(!$opensource), 1#end);

insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${math.add($menuId,4)},${menuId}, '${moduleName}_${functionName}_del', '1', null, '1', '0', null, '3', null, '${tableComment}删除', 1);
insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${math.add($menuId,4)},${menuId}, '${moduleName}_${functionName}_del', '1', null, '1', '0', null, '3', null, '${tableComment}删除'#if(!$opensource), 1#end);

insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
values (${math.add($menuId,5)},${menuId}, '${moduleName}_${functionName}_export', '1', null, '1', '0', null, '3', null, '导入导出', 1);
insert into sys_menu ( menu_id,parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name#if(!$opensource), tenant_id#end)
values (${math.add($menuId,5)},${menuId}, '${moduleName}_${functionName}_export', '1', null, '1', '0', null, '3', null, '导入导出'#if(!$opensource), 1#end);

0 comments on commit ae3cf30

Please sign in to comment.