前端:

引用signalr三方包
This commit is contained in:
2026-01-19 19:37:47 +08:00
parent e7dbb651a2
commit 507788f6a3
9 changed files with 274 additions and 9 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ namespace IM_API.Hubs
}
var userIdStr = Context.User.FindFirstValue(ClaimTypes.NameIdentifier);
await _messageService.SendPrivateMessageAsync(int.Parse(userIdStr),dto.ReceiverId,dto);
await Clients.Users(dto.ReceiverId.ToString()).SendAsync("ReceiveMessage", userIdStr, dto.Content);
await Clients.Users(dto.ReceiverId.ToString()).SendAsync("ReceiveMessage", dto);
return;
}
}