新增临时角色页面

This commit is contained in:
2025-02-24 21:25:49 +08:00
parent 53d1a19475
commit ec98add5b2
31 changed files with 194 additions and 66 deletions

View File

@@ -59,4 +59,10 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, Sy
*/
List<SysRole> selectRolesByUserName(String userName);
/**
* 获取当前用户角色对象
* @param userId
* @return
*/
SysRole getCurrentRole(Long userId);
}

View File

@@ -178,4 +178,14 @@ public interface ISysRoleService {
int insertAuthUsers(Long roleId, Long[] userIds);
void cleanOnlineUserByRole(Long roleId);
/**
*
* @return
*/
Long[] selectRoleByName();
SysRole getCurrentRole();
}

View File

@@ -440,4 +440,15 @@ public class SysRoleServiceImpl implements ISysRoleService {
}
});
}
@Override
public Long[] selectRoleByName() {
return new Long[0];
}
@Override
public SysRole getCurrentRole() {
return baseMapper.getCurrentRole(LoginHelper.getUserId());
}
}

View File

@@ -67,4 +67,14 @@
WHERE r.del_flag = '0' and u.user_name = #{userName}
</select>
<select id="getCurrentRole" resultMap="SysRoleResult">
select distinct r.role_id,
r.role_name,
r.role_key
from sys_role r
join sys_user_role sur on sur.role_id = r.role_id
where #{userId} = sur.user_id
</select>
</mapper>