Compare commits

..

No commits in common. "c17348d3ad5210ae30d5eaa882c07c3389cbe9e5" and "b65234689c2fef1636fa93201c5e3a91197cd11e" have entirely different histories.

1 changed files with 1 additions and 2 deletions

View File

@ -362,8 +362,7 @@ func ServerSendMsg(c *gin.Context) {
if len(msgs) > 0 { if len(msgs) > 0 {
msg := msgs[0] msg := msgs[0]
//发送消息 //发送消息
msg_str, _ := json.Marshal(msg) _, err := c.Writer.Write([]byte("data: " + msg.Msg + "\n\n"))
_, 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