diff --git a/config/go-fly.sql b/config/go-fly.sql index 3d87dbe..95d45ef 100644 --- a/config/go-fly.sql +++ b/config/go-fly.sql @@ -143,7 +143,7 @@ PRIMARY KEY (`id`), UNIQUE KEY `page` (`page`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8| INSERT INTO `about` (`id`, `title_cn`, `title_en`, `keywords_cn`, `keywords_en`, `desc_cn`, `desc_en`, `css_js`, `html_cn`, `html_en`, `page`) VALUES -(NULL, '免费开源客服系统GOFLY-演示页', 'Simple and Powerful Golang customer live chat-GOFLY-demo', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统', 'GO-FLY,GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers', ' ', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n 客服入口\n 接口文档\n
\n
\n
\n

极简强大的Go语言在线客服系统

\n

GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统

\n
\n
\n \n \n \n
\n
\n
\n

主要技术架构

\n

github.com/dgrijalva/jwt-go

\n

github.com/gin-gonic/gin

\n

github.com/go-sql-driver/mysql

\n

github.com/gobuffalo/packr/v2

\n

github.com/gorilla/websocket

\n

github.com/ipipdotnet/ipdb-go

\n

github.com/jinzhu/gorm

\n

github.com/satori/go.uuid

\n

github.com/spf13/cobra

\n

github.com/swaggo/gin-swagger

\n

github.com/swaggo/swag\n

\n
\n \n
\n\n\n', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n Agents Here\n API Documents\n
\n
\n

Simple and Powerful Go language online customer chat system

GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers

Main technical architecture

github.com/dgrijalva/jwt-go

github.com/gin-gonic/gin

github.com/go-sql-driver/mysql

github.com/gobuffalo/packr/v2

github.com/gorilla/websocket

github.com/ipipdotnet/ipdb-go

github.com/jinzhu/gorm

github.com/satori/go.uuid

github.com/spf13/cobra

github.com/swaggo/gin-swagger

github.com/swaggo/swag

\n\n\n', 'index')| +(NULL, '免费开源客服系统GOFLY0.3.3-演示页', 'Simple and Powerful Golang customer live chat-GOFLY-demo', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统', 'GO-FLY,GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers', ' ', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n 客服入口\n 接口文档\n
\n
\n
\n

极简强大的Go语言在线客服系统

\n

GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统

\n
\n
\n \n \n \n
\n
\n
\n

主要技术架构

\n

github.com/dgrijalva/jwt-go

\n

github.com/gin-gonic/gin

\n

github.com/go-sql-driver/mysql

\n

github.com/gobuffalo/packr/v2

\n

github.com/gorilla/websocket

\n

github.com/ipipdotnet/ipdb-go

\n

github.com/jinzhu/gorm

\n

github.com/satori/go.uuid

\n

github.com/spf13/cobra

\n

github.com/swaggo/gin-swagger

\n

github.com/swaggo/swag\n

\n
\n \n
\n\n\n', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n Agents Here\n API Documents\n
\n
\n

Simple and Powerful Go language online customer chat system

GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers

Main technical architecture

github.com/dgrijalva/jwt-go

github.com/gin-gonic/gin

github.com/go-sql-driver/mysql

github.com/gobuffalo/packr/v2

github.com/gorilla/websocket

github.com/ipipdotnet/ipdb-go

github.com/jinzhu/gorm

github.com/satori/go.uuid

github.com/spf13/cobra

github.com/swaggo/gin-swagger

github.com/swaggo/swag

\n\n\n', 'index')| DROP TABLE IF EXISTS `reply_group`| CREATE TABLE `reply_group` ( `id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/ws/user.go b/ws/user.go index f8cd819..12063ce 100644 --- a/ws/user.go +++ b/ws/user.go @@ -115,14 +115,17 @@ func SuperAdminMessage(str []byte) { //给指定客服发消息 func OneKefuMessage(toId string, str []byte) { //新版 - mKefuConns := KefuList[toId] - if mKefuConns != nil { + mKefuConns, ok := KefuList[toId] + if mKefuConns != nil && ok { + log.Println("OneKefuMessage lock") + Mux.Lock() + defer Mux.Unlock() + log.Println("OneKefuMessage unlock") for _, kefu := range mKefuConns { - Mux.Lock() kefu.Conn.WriteMessage(websocket.TextMessage, str) - Mux.Unlock() } } + SuperAdminMessage(str) } diff --git a/ws/ws.go b/ws/ws.go index c5a616a..4af674a 100644 --- a/ws/ws.go +++ b/ws/ws.go @@ -130,21 +130,8 @@ func WsServerBackend() { conn.WriteMessage(websocket.TextMessage, str) Mux.Unlock() case "inputing": - //msg := TypeMessage{ - // Type: "pong", - //} - //str, _ := json.Marshal(msg) - //var data SimpleMessage - //json.Unmarshal([]byte(typeMsg.Data.(string)),&data) - //log.Println(data) - //from:=typeMsg.Data["from"] to := typeMsg.Data.(map[string]interface{})["to"].(string) - //content:=typeMsg.Data["content"] - log.Println(to) - Mux.Lock() - //conn.WriteMessage(websocket.TextMessage, str) OneKefuMessage(to, message.content) - Mux.Unlock() } }