更新客服在线状态

pull/23/head
taoshihan1991 3 years ago
parent b6542bf42a
commit d8b4fa7d29

@ -101,6 +101,7 @@ func UpdateVisitorStatusCron() {
models.UpdateVisitorStatus(visitor.VisitorId, 0) models.UpdateVisitorStatus(visitor.VisitorId, 0)
} }
} }
SendPingToKefuClient()
time.Sleep(60 * time.Second) time.Sleep(60 * time.Second)
} }
} }
@ -137,12 +138,12 @@ func WsServerBackend() {
//json.Unmarshal([]byte(typeMsg.Data.(string)),&data) //json.Unmarshal([]byte(typeMsg.Data.(string)),&data)
//log.Println(data) //log.Println(data)
//from:=typeMsg.Data["from"] //from:=typeMsg.Data["from"]
to:=typeMsg.Data.(map[string]interface{})["to"].(string) to := typeMsg.Data.(map[string]interface{})["to"].(string)
//content:=typeMsg.Data["content"] //content:=typeMsg.Data["content"]
log.Println(to) log.Println(to)
Mux.Lock() Mux.Lock()
//conn.WriteMessage(websocket.TextMessage, str) //conn.WriteMessage(websocket.TextMessage, str)
OneKefuMessage(to,message.content) OneKefuMessage(to, message.content)
Mux.Unlock() Mux.Unlock()
} }

Loading…
Cancel
Save