diff --git a/Infrastructure/Model/TokenModel.cs b/Infrastructure/Model/TokenModel.cs index e624778..cf863a1 100644 --- a/Infrastructure/Model/TokenModel.cs +++ b/Infrastructure/Model/TokenModel.cs @@ -34,6 +34,7 @@ namespace Infrastructure.Model { UserId = info.UserId; UserName = info.UserName; + NickName = info.NickName; DeptId = info.DeptId; Roles = roles; RoleIds = roles.Select(f => f.RoleKey).ToList(); diff --git a/ZR.ServiceCore/Signalr/MessageHub.cs b/ZR.ServiceCore/Signalr/MessageHub.cs index 88303ce..a2b365e 100644 --- a/ZR.ServiceCore/Signalr/MessageHub.cs +++ b/ZR.ServiceCore/Signalr/MessageHub.cs @@ -69,7 +69,7 @@ namespace ZR.ServiceCore.Signalr Log.WriteLine(msg: $"{name},{Context.ConnectionId}连接服务端success,当前已连接{onlineClients.Count}个"); //Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}"); Clients.Caller.SendAsync(HubsConstant.MoreNotice, SendNotice()); - Clients.Caller.SendAsync(HubsConstant.ConnId, onlineUser.ConnnectionId); + // Clients.Caller.SendAsync(HubsConstant.ConnId, onlineUser.ConnnectionId); } OnlineUsers userInfo = GetUserById(userid); if (userInfo == null) @@ -91,7 +91,7 @@ namespace ZR.ServiceCore.Signalr var connIds = onlineClients.Where(f => f.Userid == userid).ToList(); userInfo.ClientNum = connIds.Count; - Clients.Clients(connIds.Select(f => f.ConnnectionId)).SendAsync("onlineInfo", userInfo); + // Clients.Clients(connIds.Select(f => f.ConnnectionId)).SendAsync("onlineInfo", userInfo); Log.WriteLine(ConsoleColor.Blue, msg: $"用户{name}已连接,今日已在线{userInfo?.TodayOnlineTime}分钟,当前已连接{onlineClients.Count}个"); //给所有用户更新在线人数