实时通讯

parent 8933af96
......@@ -53,7 +53,7 @@ public override Task OnDisconnectedAsync(Exception exception)
return base.OnDisconnectedAsync(exception);
}
public async Task AddGroup(string token, string groupName)
public async Task AddGroup(string token, int groupName)
{
var connectionId = Context.ConnectionId;
string key = $"AllotLogGroup_{connectionId}";
......@@ -66,13 +66,7 @@ public override Task OnDisconnectedAsync(Exception exception)
logger.LogDebug($"日志推送 添加用户组{connectionId}-{groupName}");
//2 将用户插入分组
await Groups.AddToGroupAsync(connectionId, groupName);
}
public Task SendMessage(string user, string message)
{
logger.LogDebug($"日志推送 SendMessage *****************************************************************************");
return Clients.All.SendAsync("ReceiveMessage", user, message);
}
await Groups.AddToGroupAsync(connectionId, groupName.ToString());
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment