diff --git a/controller/chat.go b/controller/chat.go index d7a50b2..cce4e32 100644 --- a/controller/chat.go +++ b/controller/chat.go @@ -214,7 +214,7 @@ func singleBroadcaster(){ conn := guest.conn msg := TypeMessage{ - Type: "kfChatMessage", + Type: "message", Data: ClientMessage{ Name: clientMsg.Name, Avator: clientMsg.Avator, @@ -233,7 +233,7 @@ func singleBroadcaster(){ continue } msg := TypeMessage{ - Type: "chatMessage", + Type: "message", Data: ClientMessage{ Avator: clientMsg.Avator, Id: clientMsg.Id, diff --git a/static/html/chat_main.html b/static/html/chat_main.html index f455bf9..d85dab5 100644 --- a/static/html/chat_main.html +++ b/static/html/chat_main.html @@ -232,7 +232,7 @@ // this.socket.send(JSON.stringify(mes)); //} - if (redata.type == "chatMessage") { + if (redata.type == "message") { let msg = redata.data let content = {} content.avator = msg.avator; diff --git a/static/html/chat_page.html b/static/html/chat_page.html index 3d08171..00b113d 100644 --- a/static/html/chat_page.html +++ b/static/html/chat_page.html @@ -158,13 +158,13 @@ guest.to_id=msg.id; this.chatTitle=msg.name+",正在与您沟通!" } - if (redata.type == "kfChatMessage") { + if (redata.type == "message") { let msg = redata.data guest.to_id=msg.id; let content = {} content.avator = msg.avator; - content.name = msg.kf_name; + content.name = msg.name; content.content = msg.content; content.is_kefu = false; content.time = msg.time;