2024-11-13 09:19:06 +08:00
|
|
|
|
using ce.autofac.extension;
|
|
|
|
|
|
using Infrastructure.Helpers;
|
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
|
namespace OpenAuth.App.BaseApp.ImMsgManager
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class SendHubs
|
|
|
|
|
|
{
|
|
|
|
|
|
//
|
|
|
|
|
|
// 摘要:
|
|
|
|
|
|
// 调用hub方法
|
|
|
|
|
|
//
|
|
|
|
|
|
// 参数:
|
|
|
|
|
|
// methodName:
|
|
|
|
|
|
//
|
|
|
|
|
|
// args:
|
|
|
|
|
|
// 参数
|
|
|
|
|
|
public static async Task callMethod(string imurl2, string imopen,string methodName, params object[] args)
|
|
|
|
|
|
{
|
2025-05-15 13:50:30 +08:00
|
|
|
|
//if (imopen=="false")
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
2024-11-13 09:19:06 +08:00
|
|
|
|
|
2025-05-15 13:50:30 +08:00
|
|
|
|
//if (string.IsNullOrEmpty(imurl2))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// IHttpContextAccessor accessor = IocManager.Instance.GetService<IHttpContextAccessor>();
|
|
|
|
|
|
// if (accessor.HttpContext != null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// imurl2 = accessor.HttpContext.Request.Host.Value;
|
|
|
|
|
|
// imurl2 = ((!accessor.HttpContext.Request.IsHttps) ? ("http://" + imurl2) : ("https://" + imurl2));
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
2024-11-13 09:19:06 +08:00
|
|
|
|
|
2025-05-15 13:50:30 +08:00
|
|
|
|
//HubConnection connection = new HubConnectionBuilder().WithUrl(imurl2 + "/chathub").Build();
|
|
|
|
|
|
//await connection.StartAsync();
|
|
|
|
|
|
//await connection.InvokeCoreAsync(methodName, args);
|
|
|
|
|
|
//await connection.StopAsync();
|
2024-11-13 09:19:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|