111
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace Application.Web.Controllers.Login
|
||||
{
|
||||
@@ -11,7 +12,11 @@ namespace Application.Web.Controllers.Login
|
||||
[ApiController]
|
||||
public class LoginController : ControllerBase
|
||||
{
|
||||
|
||||
private readonly IHubContext<ChatHub> _hubContext;
|
||||
public LoginController(IHubContext<ChatHub> hubContext)
|
||||
{
|
||||
_hubContext = hubContext;
|
||||
}
|
||||
/// <summary>
|
||||
/// 登录接口
|
||||
/// </summary>
|
||||
@@ -26,6 +31,7 @@ namespace Application.Web.Controllers.Login
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> Test(string name)
|
||||
{
|
||||
await _hubContext.Clients.All.SendAsync("ReceiveMessage", "系统");
|
||||
return PoAction.Ok(name);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user