Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复普通角色查询菜单报错问题 #67

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ private int insertRoleMenu(SysRoleBo role) {
rm.setMenuId(menuId);
list.add(rm);
}
if (list.size() > 0) {
if (!list.isEmpty()) {
rows = roleMenuMapper.insertBatch(list) ? list.size() : 0;
}
return rows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
from sys_menu sm
left join sys_role_menu rm on sm.menu_id = rm.menu_id
left join sys_user_role sur on rm.role_id = sur.role_id
${ew.getCustomSqlSegment}
left join sys_role ro on sur.role_id = ro.role_id
<where>
and sur.user_id = #{userId}
and ro.status = '1'
and ro.del_flag = '0'
<if test="menuName != null and menuName != ''"> and sm.menu_name like concat(concat('%', #{menuName}), '%')</if>
<if test="componentName != null and componentName != ''"> and sm.component_name like concat(concat('%', #{componentName}), '%')</if>
<if test="visible != null and visible != ''"> and sm.visible = #{visible}</if>
Expand Down Expand Up @@ -62,11 +64,11 @@
left join sys_role_menu rm on sm.menu_id = rm.menu_id
left join sys_user_role sur on rm.role_id = sur.role_id
left join sys_role ro on sur.role_id = ro.role_id
left join sys_user u on sur.user_id = u.user_id
where u.user_id = #{userId}
where sur.user_id = #{userId}
and sm.menu_type in ('M', 'C')
and sm.status = '1'
and ro.status = '1'
and ro.del_flag = '0'
order by sm.parent_id, sm.order_num
</select>

Expand Down