Эх сурвалжийг харах

fix:补充提交租户新增角色

韩帛霖 1 жил өмнө
parent
commit
60f9501061

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java

@@ -72,7 +72,7 @@ public interface SysRoleMapper {
      * @param roleKey 角色权限
      * @return 角色信息
      */
-    public SysRole checkRoleKeyUnique(String roleKey);
+    public SysRole checkRoleKeyUnique(@Param("roleKey") String roleKey, @Param("tenantId") String tenantId);
 
     /**
      * 修改角色信息

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java

@@ -153,7 +153,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
     @Override
     public boolean checkRoleKeyUnique(SysRole role) {
         Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
-        SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
+        SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey(), role.getTenantId().toString());
         if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	
 	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
-		 where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
+		 where r.role_key=#{roleKey} and r.del_flag = '0' and r.tenant_id = #{tenantId} limit 1
 	</select>
 	
  	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">