/// <summary> /// 用户离线【移除缓存】 /// </summary> /// <returns></returns> public async Task <bool> UserOffline() { var cid = Context.ConnectionId; cache.RemoveByValue(cid); await Clients.Client(cid).SendAsync("ReceiveAlarmVoice", -3, new { title = "系统消息", content = "离线成功" }); return(true); }