فهرست منبع

wip:对象调整

wangshan 2 ماه پیش
والد
کامیت
406213b4d4
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 2
      handler/activity/lotteryDrawTask.go
  2. 2 0
      services/sse/sse.go

+ 2 - 2
handler/activity/lotteryDrawTask.go

@@ -205,8 +205,8 @@ func LotteryDrawTask(msg *model.Message) {
 				userName = string(phone[0:3]) + "****" + string(phone[(len(phone)-4):])
 				userName = string(phone[0:3]) + "****" + string(phone[(len(phone)-4):])
 			}
 			}
 		}
 		}
-		util.SendNotification(msgBody.UserId, model.SseMessage{
-			//util.SendNotificationToAll(model.SseMessage{
+		//util.SendNotification(msgBody.UserId, model.SseMessage{
+		util.SendNotificationToAll(model.SseMessage{
 			Name:     taskInfo.Name,
 			Name:     taskInfo.Name,
 			User:     encrypt.SE.EncodeString(msgBody.UserId),
 			User:     encrypt.SE.EncodeString(msgBody.UserId),
 			State:    model.TaskTarget,
 			State:    model.TaskTarget,

+ 2 - 0
services/sse/sse.go

@@ -35,6 +35,8 @@ func (s *ServerSentRouter) Notify() {
 		logger.Info("params  userId:", userId)
 		logger.Info("params  userId:", userId)
 	}
 	}
 	if userId != "" {
 	if userId != "" {
+		userId = fmt.Sprintf("%s#%d", userId, time.Now().UnixMilli())
+		logger.Info("new  userId:", userId)
 		// 创建用户专属的消息通道
 		// 创建用户专属的消息通道
 		messageChan := make(chan string)
 		messageChan := make(chan string)
 		// 注册当前连接
 		// 注册当前连接