Merge branch 'refs/heads/feature-im-gitea'

This commit is contained in:
junleea 2024-08-08 16:47:20 +08:00
commit c17348d3ad
1 changed files with 2 additions and 1 deletions

View File

@ -362,7 +362,8 @@ func ServerSendMsg(c *gin.Context) {
if len(msgs) > 0 { if len(msgs) > 0 {
msg := msgs[0] msg := msgs[0]
//发送消息 //发送消息
_, err := c.Writer.Write([]byte("data: " + msg.Msg + "\n\n")) msg_str, _ := json.Marshal(msg)
_, err := c.Writer.Write([]byte("data: " + string(msg_str) + "\n\n"))
if err != nil { if err != nil {
worker.SetRedisWithExpire("user_"+strconv.Itoa(user_id)+"_status_v2", "0", time.Second*3600) worker.SetRedisWithExpire("user_"+strconv.Itoa(user_id)+"_status_v2", "0", time.Second*3600)
break break