feat: 完善离线问题

This commit is contained in:
橙子
2023-12-19 16:52:50 +08:00
parent 7766a7b239
commit 6f65ad5255
6 changed files with 6032 additions and 14 deletions

View File

@@ -13,7 +13,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
public DateTime CreationTime { get; set; } public DateTime CreationTime { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; } public bool IsDisableCreateDiscuss { get; set; }
} }
} }

View File

@@ -11,7 +11,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
public DateTime CreationTime { get; set; } public DateTime CreationTime { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; } public bool IsDisableCreateDiscuss { get; set; }
} }
} }

View File

@@ -68,11 +68,16 @@ namespace Yi.Framework.Rbac.Domain.SignalRHubs
//判断用户是否存在,否则添加集合 //判断用户是否存在,否则添加集合
if (user != null) if (user != null)
{ {
clientUsers.Remove(user); var clientUser = clientUsers.FirstOrDefault(x => x.ConnnectionId == user.ConnnectionId);
if (clientUser is not null)
{
clientUsers.Remove(clientUser);
Clients.All.SendAsync("onlineNum", clientUsers.Count); Clients.All.SendAsync("onlineNum", clientUsers.Count);
//Clients.All.SendAsync(HubsConstant.OnlineUser, clientUsers); //Clients.All.SendAsync(HubsConstant.OnlineUser, clientUsers);
_logger.LogInformation($"用户{user?.UserName}离开了,当前已连接{clientUsers.Count}个"); _logger.LogInformation($"用户{user?.UserName}离开了,当前已连接{clientUsers.Count}个");
} }
}
return base.OnDisconnectedAsync(exception); return base.OnDisconnectedAsync(exception);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -294,12 +294,7 @@ function cancel() {
} }
/** 表单重置 */ /** 表单重置 */
function reset() { function reset() {
form.value = { form.value = {};
id: undefined,
title: undefined,
isDeleted: false,
remark: undefined,
};
proxy.resetForm("dataRef"); proxy.resetForm("dataRef");
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -211,6 +211,8 @@ function cancel() {
/** 表单重置 */ /** 表单重置 */
function reset() { function reset() {
proxy.resetForm("dataRef"); proxy.resetForm("dataRef");
form.value = {
};
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
@@ -228,6 +230,7 @@ function handleAdd() {
reset(); reset();
open.value = true; open.value = true;
title.value = "添加板块"; title.value = "添加板块";
} }
/** 多选框选中数据 */ /** 多选框选中数据 */
function handleSelectionChange(selection) { function handleSelectionChange(selection) {