|
@@ -29,6 +29,7 @@ func (s *ServerSentRouter) Notify() {
|
|
|
|
|
|
sessVal := s.Session().GetMultiple()
|
|
|
userId := common.ObjToString(sessVal["userId"])
|
|
|
+ //userId = s.GetString("userId")
|
|
|
if userId != "" {
|
|
|
// 创建用户专属的消息通道
|
|
|
messageChan := make(chan string)
|
|
@@ -61,10 +62,11 @@ func (s *ServerSentRouter) Notify() {
|
|
|
func (s *ServerSentRouter) Send() {
|
|
|
msg := s.GetString("msg")
|
|
|
phone := s.GetString("phone")
|
|
|
+ userId := s.GetString("userId")
|
|
|
if msg == "" {
|
|
|
msg = "Default notification at " + time.Now().Format(time.RFC3339)
|
|
|
} else {
|
|
|
- util.SseBroadcast.SendToUsers(model.SseMessage{
|
|
|
+ util.SendNotification(userId, model.SseMessage{
|
|
|
Name: msg,
|
|
|
User: phone,
|
|
|
State: model.WinningTarget,
|