修复上次定时给客服发消息判断错误bug

master
taoshihan 2 years ago
parent 3e1ac34650
commit 6a966b60ce

@ -61,7 +61,7 @@ CREATE TABLE `user_role` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `user_role` (`id`, `user_id`, `role_id`) VALUE
(1, 1, 2)|
(1, 1, 1)|
DROP TABLE IF EXISTS `role`|
CREATE TABLE `role` (
@ -72,7 +72,7 @@ CREATE TABLE `role` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `role` (`id`, `name`, `method`, `path`) VALUES
(1, '普通客服', 'GET', 'GET:/kefuinfo,GET:/kefulist,GET:/roles,POST:/notice_save,POST:/notice')|
(1, '普通客服', '*', '*')|
DROP TABLE IF EXISTS `welcome`|
CREATE TABLE `welcome` (
@ -89,7 +89,7 @@ CREATE TABLE `welcome` (
INSERT INTO `welcome` (`id`, `user_id`, `content`, `is_default`, `ctime`, `keyword`) VALUES
(NULL, 'kefu2', '我暂时离线,留言已转发到我的邮箱,稍后回复~', 1, '2020-08-24 02:57:49','offline')|
INSERT INTO `welcome` (`id`, `user_id`, `content`, `is_default`, `ctime`, `keyword`) VALUES
(NULL, 'kefu2', '本客服代码开源,欢迎star,开源地址:https://github.com/taoshihan1991/go-fly', 0, '2020-08-24 02:57:49','welcome')|
(NULL, 'kefu2', '请问有什么可以帮您?', 0, '2020-08-24 02:57:49','welcome')|
DROP TABLE IF EXISTS `ipblack`|
CREATE TABLE `ipblack` (

@ -582,4 +582,19 @@ a{color: #07a9fe;text-decoration: none;}
}
.menuLeftItem:active, .menuLeftItem.active {
background: #2b5a96;
}
.chatNotice {
text-align: center;
margin: 12px 0px;
}
.chatNoticeContent {
display: inline-block;
word-break: break-all;
color: rgba(0,0,0,.45);
margin: 0 24px;
max-width: calc(100% - 48px);
background-color: #fff;
border-radius: 16px;
font-size: 12px;
padding: 4px 16px;
}

@ -57,8 +57,7 @@ new Vue({
return;
}
this.visitor.to_id=msg.id;
this.chatTitle=msg.name+","+GOFLY_LANG[LANG]['chating'];
$(".chatBox").append("<div class=\"chatTime\">"+this.chatTitle+"</div>");
this.showTitle(msg.name+","+GOFLY_LANG[LANG]['chating']);
this.scrollBottom();
this.showKfonline=true;
}
@ -624,7 +623,7 @@ new Vue({
});
},
showTitle:function(title){
$(".chatBox").append("<div class=\"chatTime\"><span>"+title+"</span></div>");
$(".chatBox").append("<div class='chatNotice'><div class=\"chatNoticeContent\"><span>"+title+"</span></div></div>");
this.scrollBottom();
},
},

@ -4,7 +4,7 @@
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta name="keywords" content="开源客服系统,golang在线客服,免费客服系统,go语言在线聊天工具,gofly,GOFLY客服系统"/>
<meta name="description" content="golang开发的开源免费客服系统,可独立部署客服系统,支持文字/表情/图片/文件发送,支持快捷回复,支持IP黑名单,展示访客信息,后台权限控制"/>
<title>GO语言开源客服系统-GOFLY</title>
<title>开源智能在线客服系统</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.1/theme-chalk/index.min.css">
<script src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
<script src="https://cdn.staticfile.org/element-ui/2.15.1/index.js"></script>

@ -111,7 +111,8 @@ func SendPingToKefuClient() {
kefu.Mux.Lock()
defer kefu.Mux.Unlock()
err := kefu.Conn.WriteMessage(websocket.TextMessage, str)
if err == nil {
if err != nil {
log.Println("定时发送ping给客服失败",err.Error())
delete(KefuList, kefuId)
}
}

Loading…
Cancel
Save