reactor: 获取路由菜单添加角色权限控制

This commit is contained in:
ray
2024-06-29 15:10:48 +08:00
parent da36355cd9
commit 57e6ac7fa6
7 changed files with 26 additions and 22 deletions

View File

@@ -20,9 +20,6 @@
<result property="alwaysShow" column="always_show" jdbcType="INTEGER"/>
<result property="keepAlive" column="keep_alive" jdbcType="INTEGER"/>
<result property="params" column="params" jdbcType="VARCHAR"/>
<collection property="roles" ofType="string" javaType="list">
<result column="code"/>
</collection>
</resultMap>
<!-- 获取路由列表 -->
@@ -49,6 +46,15 @@
LEFT JOIN sys_role t3 ON t2.role_id = t3.id
WHERE
t1.type != '${@com.youlai.system.enums.MenuTypeEnum@BUTTON.getValue()}'
<if test="roles != null and roles.size() > 0">
<!-- ROOT 可查看所有菜单 -->
<if test="!roles.contains('ROOT')">
AND t3.code IN
<foreach collection="roles" item="role" open="(" close=")" separator=",">
#{role}
</foreach>
</if>
</if>
ORDER BY
t1.sort
</select>