From 99901aced551f863be93345f88074aac91734f37 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Sun, 28 Jun 2020 11:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/go-fly-data.sql | 2 ++ controller/chat.go | 18 ------------------ static/html/chat_main.html | 20 ++++++++++---------- static/html/chat_page.html | 6 +++--- 4 files changed, 15 insertions(+), 31 deletions(-) diff --git a/config/go-fly-data.sql b/config/go-fly-data.sql index e69de29..e3d3fef 100644 --- a/config/go-fly-data.sql +++ b/config/go-fly-data.sql @@ -0,0 +1,2 @@ +INSERT INTO `user` (`id`, `name`, `password`, `nickname`, `created_at`, `updated_at`, `deleted_at`, `avator`) VALUES +(null, 'kefu2', '202cb962ac59075b964b07152d234b70', '小白菜', '2020-06-28 03:32:41', '2020-06-28 03:32:41', NULL, 'https://www.wolive.cc/assets/upload/3.jpg'); \ No newline at end of file diff --git a/controller/chat.go b/controller/chat.go index 95f7790..9d7111f 100644 --- a/controller/chat.go +++ b/controller/chat.go @@ -36,24 +36,6 @@ type ClientMessage struct { ToId string `json:"to_id"` Content string `json:"content"` } -type KfMessage struct { - Kf_name string `json:"kf_name"` - Avatar string `json:"avatar"` - Kf_id string `json:"kf_id"` - Kf_group string `json:"kf_group"` - Time string `json:"time"` - Guest_id string `json:"guest_id"` - Content string `json:"content"` -} -type UserMessage struct { - From_avatar string `json:"from_avatar"` - From_id string `json:"from_id"` - From_name string `json:"from_name"` - To_id string `json:"to_id"` - To_name string `json:"to_name"` - Time string `json:"time"` - Content string `json:"content"` -} //定时检测客户端是否在线 func init() { upgrader=websocket.Upgrader{ diff --git a/static/html/chat_main.html b/static/html/chat_main.html index 204aac4..706f968 100644 --- a/static/html/chat_main.html +++ b/static/html/chat_main.html @@ -80,7 +80,7 @@