优化取消发言观看对象
This commit is contained in:
parent
32374a9cd4
commit
c3b32f4a5c
|
|
@ -99,16 +99,18 @@ namespace WGShare.API.Controllers.Frontend
|
||||||
|
|
||||||
// 判断是否显示用户
|
// 判断是否显示用户
|
||||||
var showUserId = RedisHelper.Instance.HGet(RedisKeyConstant.SessionManage.GetChannelShowUserKey(TenantId), inputDTO.RoomNum);
|
var showUserId = RedisHelper.Instance.HGet(RedisKeyConstant.SessionManage.GetChannelShowUserKey(TenantId), inputDTO.RoomNum);
|
||||||
if (showUserId == inputDTO.UserId)
|
if (showUserId == inputDTO.UserId || showUserId == user.ScreenShareId)
|
||||||
{
|
{
|
||||||
// 取消显示用户,设置显示管理员
|
|
||||||
var users = RedisHelper.Instance.HVals<ChannelUserInfo>(RedisKeyConstant.SessionManage.GetChannelUserKey(TenantId, inputDTO.RoomNum));
|
//var users = RedisHelper.Instance.HVals<ChannelUserInfo>(RedisKeyConstant.SessionManage.GetChannelUserKey(TenantId, inputDTO.RoomNum));
|
||||||
var showUser = users.FirstOrDefault(x => x.RoleId == ((int)RoleEnums.Admin).ToString() || x.IsRoomManager || x.RoleId == ((int)RoleEnums.RoomManager).ToString());
|
//var showUser = users.FirstOrDefault(x => x.RoleId == ((int)RoleEnums.Admin).ToString() || x.IsRoomManager || x.RoleId == ((int)RoleEnums.RoomManager).ToString());
|
||||||
if (showUser != null)
|
//if (showUser != null)
|
||||||
{
|
//{
|
||||||
RedisHelper.Instance.HSet(RedisKeyConstant.SessionManage.GetChannelShowUserKey(TenantId), inputDTO.RoomNum, showUser.UID);
|
|
||||||
await _hubContext.Clients.Group(inputDTO.RoomNum).ShowUser(showUser.UID, showUser.UserName, string.Empty, string.Empty);
|
// 取消显示用户,设置显示当前操作的管理员
|
||||||
}
|
RedisHelper.Instance.HSet(RedisKeyConstant.SessionManage.GetChannelShowUserKey(TenantId), inputDTO.RoomNum, UId);
|
||||||
|
await _hubContext.Clients.Group(inputDTO.RoomNum).ShowUser(UId, UserName, string.Empty, string.Empty);
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue