Commit b8f7c6ac by chenxianqi

publish v2

parent e495db95
Showing with 77 additions and 132 deletions
......@@ -4,3 +4,4 @@ kefu_server
kefu_server.tar.gz
conf/app.back.conf
node_modules
app copy.conf
\ No newline at end of file
......@@ -2,6 +2,16 @@
# 欢迎使用本客服系统 v2.0.0
## 以下是v2.0.0版本的重要更新
- 对前面版本进行重构,分离业务逻辑与机器人的混搭运行弊端
- 做了大量优化,在很大程度上提升了性能,并代码松耦合,
- 业务系统支持负载均衡了,这是对v1.0的重大里程碑更新, 对接海量客户不再愁了
- 增加工单系统能力,无在线客服接待?不用怕,工单来给您解决一切问题
- 代码可读性大大提高,初学者都能看懂的代码,还有什么理由不学习一下呢
- 定时清理无接入人工记录的用户,避免数据沉淀
- H5客户端增加了重连机制
- 客户端只保留30天聊天记录,消息记录已分表处理
![客服系统](http://qiniu.cmp520.com/kefuxitonh.jpg)
**客服系统** 是基于小米消息云实现的一款简单实用的面向多终端的客服系统,支持H5,PC,桌面,小程序,APP,flutter, 所有源码开源,长期维护,快速接入,易扩展,易整合现有的业务,开箱即用,无缝对接。
......@@ -9,6 +19,7 @@
**[小米消息云][7](MIMC)** 是小米自研的一种安全、可靠、易用的分布式IM云服务。为广大开发者提供免费快捷的即时通讯接入服务
## 当前客服系统支持功能
- 内置工单系统
- 支持多客服坐席
- 支持客服多终端同时在线
- 支持实时预览用户的输入内容
......@@ -27,7 +38,6 @@
## 接下来开发的功能
- 服务评分,本次服务评分,统计客服整体评分
- 工单系统,非客服值班时间,可提供客户提交工单留言
## 本项目关联GIT项目资源连接
......@@ -77,93 +87,36 @@
## 如何使用本系统
## 安装
##### 1.GO环境变量配置
GO 》》》》》 [移步去GO官网][8]
##### 2.clone 本项目到 $GOPATH/src 目录下
cd $GOPATH/src && git clone https://github.com/chenxianqi/kefu_server
##### 3.安装依赖库
安装 beego框架 [移步去beego官网][9]
* go get github.com/astaxie/beego
* go get github.com/beego/bee
安装 MIMC GO sdk [移步去MIMC官网][7]
* go get github.com/Xiaomi-mimc/mimc-go-sdk
* cd $GOPATH/src/github.com/Xiaomi-mimc/mimc-go-sdk
* go build
* go install
安装 protobuf
* go get github.com/golang/protobuf/proto
* cd $GOPATH/src/github.com/golang/protobuf/proto
* go build
* go install
- clone 本项目到 $GOPATH/src 目录下
- cd $GOPATH/src && git clone https://github.com/chenxianqi/kefu_server
安装 其他依赖库
* go get github.com/astaxie/beego/cache
* go get -u github.com/qiniu/api.v7
##### 4.去小米开发平台申请APPID
## 去小米开放平台申请小米APPID信息
GO 》》》》》 [小米开放平台][6]
##### 5.配置文件产考 kefu_server/conf/app.conf
``` go
appname = kefu_server
runmode = "dev"
httpport = 8080
copyrequestbody = true
viewspath = "public"
# 使用本地存储时使用的地址
static_host = "http://localhost:8080/static/uploads/images"
# 小米mimc open api URL
mimc_HttpUrl = "https://mimc.chat.xiaomi.net/api/account/token"
[dev]
httpaddr = "localhost"
# 小米mimc配置信息(小米开放平台创建)
mimc_appId =
mimc_appKey = ""
mimc_appSecret = ""
# IM数据库信息
kf_alias_name = "default"
kf_driver_name= "mysql"
kf_mysql_host = "localhost"
kf_mysql_user = "root"
kf_mysql_db = "kefu_server"
kf_mysql_pwd = "keith"
```
## 配置文件产考 kefu_server/conf/app.conf
> **Note:** 根据beego的配置文件配置,填写从小米开放平台获得的appId,appKey, appSecret, 以及您的数据库连接,账号,密码
##### 7.创建一个数据库,导入初始数据
## 创建一个数据库,导入初始数据
登录上面配置的数据库,创建一个名为kefu_server的数据库,将[kefu_server/kefu_server.sql]初始数据,导入即可
##### 8.运行项目
## 运行项目
bee run
##### 9.打包发布
bee pack -be GOOS=linux
##### 9.打包发布 linux (其它运行环境编译请自行search baidu)
bee pack -be GOOS=linux OR CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
> **静态资源目录:**
本项目默认配置已打开静态资源目录,PC工作台与H5可直接打包放进相应的目录使用,也可以独立开设站点使用
本项目demo直接使用内置静态资源目录、
本项目默认配置已打开静态资源目录,也可以独立开设站点运行
public/admin 工作台
public/client 客户端
## LICENSE
Copyright 2019 keith
Licensed to the Apache Software Foundation (ASF) under one or more contributor
......
version = "v2.0.0"
appname = kefu_server
runmode = "dev"
runmode = "prod"
httpport = 8080
copyrequestbody = true
viewspath = "public"
......@@ -11,10 +11,10 @@ grpc_port = 8028
# 客服客户端前台地址
# 1.工单邮件会发送
kefu_client_url = "http://localhost:8080"
kefu_client_url = "http://kf.aissz.com:666"
# 用于本地服务静态资源地址
static_host = "http://localhost:8080"
static_host = "http://kf.aissz.com:666"
# 进程监控
# EnableAdmin = false
......@@ -32,8 +32,8 @@ mimc_HttpUrl = "https://mimc.chat.xiaomi.net/api/account/token"
#HTTPSKeyFile = "conf/ssl.key"
# Email
email_name = "某某公司"
email_user = "xxx"
email_name = "客服系统-test"
email_user = "xxx@qq.com"
email_pass = "xxx"
email_host = "smtp.qq.com"
email_port = "465"
......@@ -44,31 +44,32 @@ open_workorder_email = true
[dev]
httpaddr = "localhost"
# 小米mimc配置信息(小米开放平台创建)
mimc_appId =
mimc_appKey = ""
mimc_appSecret = ""
mimc_appId = 888888888888
mimc_appKey = "888888888888"
mimc_appSecret = "wjLFWivIORCFsi3tHr9wHQ=="
# IM数据库信息
kf_alias_name = "default"
kf_driver_name= "mysql"
kf_mysql_host = "host"
kf_mysql_host = "192.168.31.72"
kf_mysql_port = "3306"
kf_mysql_user = "user"
kf_mysql_db = "kefu_server"
kf_mysql_pwd = "pwd"
kf_mysql_user = "root"
kf_mysql_db = "kefu_server_dev"
kf_mysql_pwd = "chenxianqi"
[prod]
httpaddr = "localhost"
# 小米mimc配置信息(小米开放平台创建)
mimc_appId =
mimc_appKey = ""
mimc_appSecret = ""
mimc_appId = 888888888888
mimc_appKey = "888888888888"
mimc_appSecret = "wjLFWivIORCFsi3tHr9wHQ=="
# IM数据库信息
kf_alias_name = "default"
kf_driver_name= "mysql"
kf_mysql_host = "host"
kf_mysql_host = "127.0.0.1"
kf_mysql_port = "3306"
kf_mysql_user = "user"
kf_mysql_user = "root"
kf_mysql_db = "kefu_server"
kf_mysql_pwd = "pwd"
kf_mysql_pwd = "chenxianqi"
......@@ -116,14 +116,15 @@ func (c *PublicController) Register() {
_md5Token := hex.EncodeToString(m5.Sum(nil))
// update userinfo
c.UserRepository.Update(user.ID, orm.Params{
userInfo := orm.Params{
"Online": 1,
"RemoteAddr": currentRemoteAddr,
"Address": sessionRequestDto.Address,
"Platform": sessionRequestDto.Platform,
"LastActivity": time.Now().Unix(),
"Token": _md5Token,
})
}
c.UserRepository.Update(user.ID, userInfo)
user.Token = _md5Token
} else {
......
......@@ -3,14 +3,10 @@
# ! /bin/sh
CURRENT_PATH=$(readlink -f "$(dirname "$0")")
SERVICE_PATH="$CURRENT_PATH/kefu_server"
ROBOT_SERVICE_PATH="$SERVICE_PATH/robot"
SERVICE_NAME="kefu_server"
ROBOT_SERVICE_NAME="kefu_go_robot"
START_CMD_SERVER="nohup ./$SERVICE_NAME &"
START_CMD_ROBOT="nohup ./$ROBOT_SERVICE_NAME &"
LOG_FILE="restart.log"
cd $SERVICE_PATH
cd $CURRENT_PATH
pwd
while true
do
......@@ -21,13 +17,6 @@ do
echo `date +%Y-%m-%d` `date +%H:%M:%S` $SERVICE_NAME >>$LOG_FILE
${START_CMD_SERVER}
fi
procnum_robot=`ps -ef|grep $ROBOT_SERVICE_NAME|grep -v grep|wc -l`
if [ $procnum_robot -eq 0 ]
then
echo "start robot service...................."
echo `date +%Y-%m-%d` `date +%H:%M:%S` $ROBOT_SERVICE_NAME >>$LOG_FILE
${START_CMD_ROBOT}
fi
sleep 5
done
......
.el-tag+.el-tag[data-v-015f50bf]{margin-left:10px}.button-new-tag[data-v-015f50bf]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-015f50bf]{width:150px;margin-left:10px;vertical-align:bottom}.el-tag+.el-tag[data-v-7b12f7d6]{margin-left:10px}.button-new-tag[data-v-7b12f7d6]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-7b12f7d6]{width:150px;margin-left:10px;vertical-align:bottom}.me-head[data-v-22f8e0fa]{height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:20px;-ms-flex-pack:justify;justify-content:space-between;color:#666}.me-head i[data-v-22f8e0fa]{margin-right:5px}
\ No newline at end of file
.el-tag+.el-tag[data-v-015f50bf]{margin-left:10px}.button-new-tag[data-v-015f50bf]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-015f50bf]{width:150px;margin-left:10px;vertical-align:bottom}.el-tag+.el-tag[data-v-7b12f7d6]{margin-left:10px}.button-new-tag[data-v-7b12f7d6]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-7b12f7d6]{width:150px;margin-left:10px;vertical-align:bottom}.me-head[data-v-a8bca088]{height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:20px;-ms-flex-pack:justify;justify-content:space-between;color:#666}.me-head i[data-v-a8bca088]{margin-right:5px}
\ No newline at end of file
......@@ -47,4 +47,4 @@
}
input:-ms-input-placeholder{ /* Internet Explorer 10-11 */
color:#ccc;
}</style><link href=css/chunk-027be9b0.1440a418.css rel=prefetch><link href=css/chunk-0673cf5f.70fac712.css rel=prefetch><link href=css/chunk-08473d3a.77daa9fe.css rel=prefetch><link href=css/chunk-1b20b679.bbe54d80.css rel=prefetch><link href=css/chunk-1e573615.be89fdde.css rel=prefetch><link href=css/chunk-2c35a188.1b64d1d6.css rel=prefetch><link href=css/chunk-4d213a0b.e2ea152d.css rel=prefetch><link href=css/chunk-56896308.67b3f13c.css rel=prefetch><link href=css/chunk-5d055fa8.421f5736.css rel=prefetch><link href=css/chunk-650419d0.3897bea9.css rel=prefetch><link href=css/chunk-724a4e2a.507bad62.css rel=prefetch><link href=js/chunk-027be9b0.82b19114.js rel=prefetch><link href=js/chunk-0673cf5f.add337a2.js rel=prefetch><link href=js/chunk-08473d3a.6fedc216.js rel=prefetch><link href=js/chunk-1b20b679.382e3755.js rel=prefetch><link href=js/chunk-1e573615.b0bc273f.js rel=prefetch><link href=js/chunk-2c35a188.390e0317.js rel=prefetch><link href=js/chunk-343c8d41.1c228cb2.js rel=prefetch><link href=js/chunk-4d213a0b.fb158f44.js rel=prefetch><link href=js/chunk-56896308.1e1828c7.js rel=prefetch><link href=js/chunk-5d055fa8.e8e1e5e1.js rel=prefetch><link href=js/chunk-650419d0.777da29b.js rel=prefetch><link href=js/chunk-724a4e2a.f39d7234.js rel=prefetch><link href=css/app.ba710877.css rel=preload as=style><link href=css/chunk-vendors.cb739fea.css rel=preload as=style><link href=js/app.8eb7de09.js rel=preload as=script><link href=js/chunk-vendors.420bd1eb.js rel=preload as=script><link href=css/chunk-vendors.cb739fea.css rel=stylesheet><link href=css/app.ba710877.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.420bd1eb.js></script><script src=js/app.8eb7de09.js></script></body></html>
\ No newline at end of file
}</style><link href=css/chunk-027be9b0.1440a418.css rel=prefetch><link href=css/chunk-0673cf5f.70fac712.css rel=prefetch><link href=css/chunk-08473d3a.77daa9fe.css rel=prefetch><link href=css/chunk-08627161.c1f4f120.css rel=prefetch><link href=css/chunk-1e573615.be89fdde.css rel=prefetch><link href=css/chunk-4d213a0b.e2ea152d.css rel=prefetch><link href=css/chunk-56896308.67b3f13c.css rel=prefetch><link href=css/chunk-5d055fa8.421f5736.css rel=prefetch><link href=css/chunk-650419d0.3897bea9.css rel=prefetch><link href=css/chunk-724a4e2a.507bad62.css rel=prefetch><link href=css/chunk-c7fc5930.bcce8317.css rel=prefetch><link href=js/chunk-027be9b0.82b19114.js rel=prefetch><link href=js/chunk-0673cf5f.add337a2.js rel=prefetch><link href=js/chunk-08473d3a.6fedc216.js rel=prefetch><link href=js/chunk-08627161.9b98f2f4.js rel=prefetch><link href=js/chunk-1e573615.b0bc273f.js rel=prefetch><link href=js/chunk-343c8d41.1c228cb2.js rel=prefetch><link href=js/chunk-4d213a0b.fb158f44.js rel=prefetch><link href=js/chunk-56896308.1e1828c7.js rel=prefetch><link href=js/chunk-5d055fa8.e8e1e5e1.js rel=prefetch><link href=js/chunk-650419d0.777da29b.js rel=prefetch><link href=js/chunk-724a4e2a.f39d7234.js rel=prefetch><link href=js/chunk-c7fc5930.19fe36cd.js rel=prefetch><link href=css/app.ba710877.css rel=preload as=style><link href=css/chunk-vendors.cb739fea.css rel=preload as=style><link href=js/app.c7ba127a.js rel=preload as=script><link href=js/chunk-vendors.420bd1eb.js rel=preload as=script><link href=css/chunk-vendors.cb739fea.css rel=stylesheet><link href=css/app.ba710877.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.420bd1eb.js></script><script src=js/app.c7ba127a.js></script></body></html>
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
.no-data[data-v-7e3638ea]{text-align:center;padding-top:50px}.no-data img[data-v-7e3638ea]{width:50px;height:50px}.no-data div[data-v-7e3638ea]{color:#666;font-size:14px}.list[data-v-7e3638ea]{padding-top:50px}.list.hide-header[data-v-7e3638ea]{padding-top:0}.list li[data-v-7e3638ea]{padding:10px 20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qwsm0SXwgOAHn8A0GtacIAOouIAfUTFATroigN0EPWKA7x2+ri1YX98bwgAa6Xb2O7CIvB1mqZpYyhJ81prLaUAgETNFUEAYIVIG5tI1gC11mUULKPhf7wezgHuIcI8z/vn5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XGAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC) 10px no-repeat;background-size:25px;padding-left:40px;padding-right:70px;border-bottom:1px solid #ddd;position:relative;height:40px}.list li .title[data-v-7e3638ea]{font-size:15px;color:#333;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.list li .type[data-v-7e3638ea]{font-size:13px;color:#666}.list li .date[data-v-7e3638ea]{margin-left:10px;font-size:13px;color:#999}.list li i[data-v-7e3638ea]{font-style:normal;font-size:13px;position:absolute;right:10px;top:0;height:20px;bottom:0;margin:auto 0}
\ No newline at end of file
.no-data[data-v-6ca82fb2]{text-align:center;padding-top:50px}.no-data img[data-v-6ca82fb2]{width:50px;height:50px}.no-data div[data-v-6ca82fb2]{color:#666;font-size:14px}.list[data-v-6ca82fb2]{padding-top:50px}.list.hide-header[data-v-6ca82fb2]{padding-top:0}.list li[data-v-6ca82fb2]{padding:10px 20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qwsm0SXwgOAHn8A0GtacIAOouIAfUTFATroigN0EPWKA7x2+ri1YX98bwgAa6Xb2O7CIvB1mqZpYyhJ81prLaUAgETNFUEAYIVIG5tI1gC11mUULKPhf7wezgHuIcI8z/vn5+eX6GcBQEDBS1NAIOTqSwHgUyocYDU2pw1xgIB4OMBRPNYAAYoaL3WZAtR79JMtVynlEaeA7v22AECV5J9B4rINLGW5HTBJIKi1/iylnKz2Vdp2XQOokrwFQKOLqi4750oyAA6Hw8tut1sg+PJSaTsCAKpCKuPIAMAB/imLy3kApoBj0VQ2dWMKUI5cVSwcYFESAOI8MQUwBbALiI8j3wg4gG/tJJkDgERG3yAA4Fs7SeYAIJHRNwgA+NZOkjkASGT0DQIAvrWTZA4AEhl9gwCAb+0kmQOAREbfIADgWztJ5gAgkdE3CAD41k6SOQBIZPQNkhKAS532LePvzJtOCaUE4NJJWAD4VEB12uohTwXjAJ+FTukAAAAAZ8/BMQXkmgLO/eLGmYF9y8/FUk4BzlVW5w4AakXN4gGAWcHU6QKAWlGzeABgVjB1ugCgVtQsHgCYFUydLgCoFTWLBwBmBVOnCwBqRc3iAYBZwdTppgTg2OnlCSM3b1fvdrv3a+2W988VZbnm0nvqIh7jvXEvYKWy3A5OfjuYE0GDALA84XKapv3Kgf+3GQAMAkDruTUAGAQAHOCL9+U7FdwKALuAQRygdQrYumYYuX3K7wFGLujWvgHAVsUGaw8AgxV0a3esAWhdBG4VaeT21gCwCIyjaQ0ADgAATV8Fx2UbJ4K1AzAFxEEEgLiG1hGsAWANEGfPGoBRp4DjfwZvqu48z28tf/duDcCoDtDy93WtgwEANo2z+zQGgG86X/r38Fbq71PG9k8BAAA4e9L4GlKtg8F6CmjtdPvYvM+VOAAO0PT8onS/Cxh1F3Afn/n4FOspAADiqABAXEPrCABgXb548tYAjLoLiJd1fQQAWK/VkC2tAWARGGfSGgCmgOQA4AAAwJnAIAPWUwAOEKw+3wTGBXSPYO0ALALj+F15XpJker35FK41Xch2IGSNJqo21g7AGiCOgTUATAHJAcABAECyUInL6BvBegrAAeLgWe8CAKAfAKr1VddtYCnlNS4BEUopJ4dQXQCgep0UAIBOwrqEBQCXSnXKEwA6CWsUVrLF7r0INNLTK9VHdAAvBQfItuWnZt+7LXGAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC) 10px no-repeat;background-size:25px;padding-left:40px;padding-right:70px;border-bottom:1px solid #ddd;position:relative;height:40px}.list li .title[data-v-6ca82fb2]{font-size:15px;color:#333;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.list li .type[data-v-6ca82fb2]{font-size:13px;color:#666}.list li .date[data-v-6ca82fb2]{margin-left:10px;font-size:13px;color:#999}.list li i[data-v-6ca82fb2]{font-style:normal;font-size:13px;position:absolute;right:10px;top:0;height:20px;bottom:0;margin:auto 0}.floting[data-v-6ca82fb2]{width:30px;height:30px;border-radius:100%;background:#26a2ff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABDElEQVRoQ+2a0Q3CMAxEffMwBHQIWAdYB4agTGZk1FQ0ClIrxx+uLp9Vm+QuL1FOLiR5Q/L5S6gAVT2ZQQDGKKPCBKjqS0S+AkRkBDBEiAgRoKpnEXlUE74AePYWESXgJiLXarJ3APa8a6OAlp2qyhVYyxkRIkJrWfnzHhEiQkTI6QARchrIU4gI9UZoCiMHZ7/HnzRWurJY+Xb2a8luEU8Xe6CKgc6xwj5fxNNZwBTALcdmaHM83Y8Asz01QoWb1Ju4F/zMxBuc5FWCV4kNuLReJUJEiAg5HSBCTgN5ChEhIuR0YK8IWX24ztdDRME75BRqxNNche4qntqvBt0L3GWMsBUI2FrNLtML+ACBe94xTRzArgAAAABJRU5ErkJggg==) 50% no-repeat;background-size:15px;position:fixed;bottom:30px;right:10px}
\ No newline at end of file
......@@ -43,4 +43,4 @@
top:0 !important;
min-height: inherit!important;
left:0 !important; right:0 !important; bottom:0 !important; margin: auto !important;
}</style><link href=css/chunk-4d07cf27.e858a48c.css rel=prefetch><link href=css/chunk-5750b049.975722ef.css rel=prefetch><link href=css/chunk-5abde09c.21a06077.css rel=prefetch><link href=css/chunk-5e6009ff.86cb9867.css rel=prefetch><link href=js/chunk-4d07cf27.b29c1461.js rel=prefetch><link href=js/chunk-5750b049.b7cee639.js rel=prefetch><link href=js/chunk-5abde09c.95818801.js rel=prefetch><link href=js/chunk-5e6009ff.0885859d.js rel=prefetch><link href=css/app.19de1655.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.8fe8d256.js rel=preload as=script><link href=js/chunk-vendors.a823ad66.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.19de1655.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.a823ad66.js></script><script src=js/app.8fe8d256.js></script></body></html>
\ No newline at end of file
}</style><link href=css/chunk-28ddead2.96f83ab8.css rel=prefetch><link href=css/chunk-5750b049.975722ef.css rel=prefetch><link href=css/chunk-5abde09c.21a06077.css rel=prefetch><link href=css/chunk-5e6009ff.86cb9867.css rel=prefetch><link href=js/chunk-28ddead2.25a13c55.js rel=prefetch><link href=js/chunk-5750b049.b7cee639.js rel=prefetch><link href=js/chunk-5abde09c.95818801.js rel=prefetch><link href=js/chunk-5e6009ff.cb477013.js rel=prefetch><link href=css/app.19de1655.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.96f57816.js rel=preload as=script><link href=js/chunk-vendors.a823ad66.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.19de1655.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.a823ad66.js></script><script src=js/app.96f57816.js></script></body></html>
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-28ddead2"],{3563:function(t,e,A){"use strict";var r=A("b9df"),o=A.n(r);o.a},"7d02":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qw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gTUATAHJAcABAECyUInL6BvBegrAAeLgWe8CAKAfAKr1VddtYCnlNS4BEUopJ4dQXQCgep0UAIBOwrqEBQCXSnXKEwA6CWsUVrLF7r0INNLTK9VHdAAvBQfItuWnZt+7LXGAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC"},b9df:function(t,e,A){},fb09:function(t,e,A){"use strict";A.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"container"},[t.isShowHeader?r("mt-header",{attrs:{fixed:"",title:"我的工单"}},[r("div",{attrs:{slot:"left"},slot:"left"},[r("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),r("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.$router.push("/workorder/create")}},slot:"right"},[r("span",[t._v("创建工单")])])],1):t._e(),r("div",{staticClass:"list",class:{"hide-header":!t.isShowHeader}},[t.workorders.length<=0?r("div",{staticClass:"no-data"},[r("img",{attrs:{src:A("7d02"),alt:""}}),r("div",[t._v("没有相关记录~")])]):r("ul",[t._l(t.workorders,(function(e,A){return[r("li",{key:A,on:{click:function(A){return t.$router.push("/workorder/detail/"+e.id)}}},[r("div",{staticClass:"title"},[t._v(t._s(e.title))]),r("div",[r("span",{staticClass:"type"},[t._v(t._s(t.getTypeName(e.tid)))]),r("span",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])]),1==e.status?r("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==e.status?r("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])]}))],2)]),t.isShowHeader?t._e():r("div",{staticClass:"floting",on:{click:function(e){return t.$router.push("/workorder/create")}}})],1)},o=[],n=(A("8e6e"),A("ac6a"),A("456d"),A("bd86")),s=A("2f62");function i(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),A.push.apply(A,r)}return A}function c(t){for(var e=1;e<arguments.length;e++){var A=null!=arguments[e]?arguments[e]:{};e%2?i(Object(A),!0).forEach((function(e){Object(n["a"])(t,e,A[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):i(Object(A)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(A,e))}))}return t}var a={name:"workorder",components:{},data:function(){return{}},created:function(){document.title="我的工单"},computed:c({},Object(s["b"])(["isShowHeader","workorders","workorderTypes"])),mounted:function(){this.$store.dispatch("onGetWorkorderTypes"),this.$store.dispatch("onGetWorkorders")},methods:{getTypeName:function(t){try{return this.workorderTypes.filter((function(e){return e.id==t}))[0].title}catch(e){return console.log(e),""}}}},u=a,d=(A("3563"),A("2877")),l=Object(d["a"])(u,r,o,!1,null,"6ca82fb2",null);e["default"]=l.exports}}]);
//# sourceMappingURL=chunk-28ddead2.25a13c55.js.map
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4d07cf27"],{"64ba":function(t,e,A){},"7d02":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qwsm0SXwgOAHn8A0GtacIAOouIAfUTFATroigN0EPWKA7x2+ri1YX98bwgAa6Xb2O7CIvB1mqZpYyhJ81prLaUAgETNFUEAYIVIG5tI1gC11mUULKPhf7wezgHuIcI8z/vn5+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GAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC"},d72e:function(t,e,A){"use strict";var r=A("64ba"),o=A.n(r);o.a},fb09:function(t,e,A){"use strict";A.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"container"},[t.isShowHeader?r("mt-header",{attrs:{fixed:"",title:"我的工单"}},[r("div",{attrs:{slot:"left"},slot:"left"},[r("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),r("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.$router.push("/workorder/create")}},slot:"right"},[r("span",[t._v("创建工单")])])],1):t._e(),r("div",{staticClass:"list",class:{"hide-header":!t.isShowHeader}},[t.workorders.length<=0?r("div",{staticClass:"no-data"},[r("img",{attrs:{src:A("7d02"),alt:""}}),r("div",[t._v("没有相关记录~")])]):r("ul",[t._l(t.workorders,(function(e,A){return[r("li",{key:A,on:{click:function(A){return t.$router.push("/workorder/detail/"+e.id)}}},[r("div",{staticClass:"title"},[t._v(t._s(e.title))]),r("div",[r("span",{staticClass:"type"},[t._v(t._s(t.getTypeName(e.tid)))]),r("span",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])]),1==e.status?r("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==e.status?r("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])]}))],2)])],1)},o=[],n=(A("8e6e"),A("ac6a"),A("456d"),A("bd86")),s=A("2f62");function i(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),A.push.apply(A,r)}return A}function a(t){for(var e=1;e<arguments.length;e++){var A=null!=arguments[e]?arguments[e]:{};e%2?i(Object(A),!0).forEach((function(e){Object(n["a"])(t,e,A[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):i(Object(A)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(A,e))}))}return t}var c={name:"workorder",components:{},data:function(){return{}},created:function(){document.title="我的工单"},computed:a({},Object(s["b"])(["isShowHeader","workorders","workorderTypes"])),mounted:function(){this.$store.dispatch("onGetWorkorderTypes"),this.$store.dispatch("onGetWorkorders")},methods:{getTypeName:function(t){try{return this.workorderTypes.filter((function(e){return e.id==t}))[0].title}catch(e){return console.log(e),""}}}},u=c,d=(A("d72e"),A("2877")),g=Object(d["a"])(u,r,o,!1,null,"7e3638ea",null);e["default"]=g.exports}}]);
//# sourceMappingURL=chunk-4d07cf27.b29c1461.js.map
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -120,7 +120,7 @@ func (r *KnowledgeBaseRepository) GetKnowledgeBases(request *models.KnowledgePag
if k != "" {
like = ("sub_title LIKE '%" + k + "%' OR title LIKE '%" + k + "%' OR content LIKE '%" + k + "%' AND")
}
total, err := r.o.Raw("SELECT * FROM knowledge_base WHERE "+like+" `platform` = ? ORDER BY create_at DESC LIMIT ? OFFSET ?", request.Platform, request.PageSize, (request.PageOn-1)*request.PageSize).QueryRows(&lists)
_, err := r.o.Raw("SELECT * FROM knowledge_base WHERE "+like+" `platform` = ? ORDER BY create_at DESC LIMIT ? OFFSET ?", request.Platform, request.PageSize, (request.PageOn-1)*request.PageSize).QueryRows(&lists)
if err != nil {
logs.Warn("GetKnowledgeBases get one KnowledgeBases------------", err)
return nil, err
......@@ -136,7 +136,13 @@ func (r *KnowledgeBaseRepository) GetKnowledgeBases(request *models.KnowledgePag
for index := range lists {
lists[index].SubTitle = strings.Trim(lists[index].SubTitle, "|")
}
request.Total = total
type KnowledgeBaseCount struct {
Count int64
}
var knowledgeBaseCount KnowledgeBaseCount
r.o.Raw("SELECT COUNT(*) AS `count` FROM knowledge_base WHERE "+like+" `platform` = ?", request.Platform).QueryRow(&knowledgeBaseCount)
request.Total = knowledgeBaseCount.Count
request.List = &lists
return request, nil
......
......@@ -23,11 +23,11 @@ func appTask() {
// user
userOfflineCount := services.GetUserRepositoryInstance().CheckUsersLoginTimeOutAndSetOffline(userOffLineUnixTimer)
logs.Info("清理登录超时user", userOfflineCount, "个被强制下线")
logs.Error("清理登录超时user", userOfflineCount, "个被强制下线")
// admin
adminOfflineCount := services.GetAdminRepositoryInstance().CheckAdminsLoginTimeOutAndSetOffline(adminOffLineUnixTimer)
logs.Info("清理登录超时admin", adminOfflineCount, "个被强制下线")
logs.Error("清理登录超时admin", adminOfflineCount, "个被强制下线")
// get offline all robots
robots, _ := services.GetRobotRepositoryInstance().GetRobotOnlineAll()
......@@ -36,7 +36,7 @@ func appTask() {
}
contacts := services.GetContactRepositoryInstance().GetTimeOutList(lastMessageUnixTimer)
logs.Info("清理会话超时用户,有", len(contacts), "个被结束对话")
logs.Error("清理会话超时用户,有", len(contacts), "个被结束对话")
for _, contact := range contacts {
// set end is session end
......
......@@ -15,7 +15,7 @@ func clearUser() {
clearUserTk := toolbox.NewTask("clearUser", "0 0 03 * * * ", func() error {
ids := services.GetUserRepositoryInstance().ClearWhiteUser()
services.GetMessageRepositoryInstance().DeleteWhiteMessage(ids)
logs.Info("定时清理了", len(ids), "个没有服务记录的用户~")
logs.Error("定时清理了", len(ids), "个没有服务记录的用户~")
return nil
})
toolbox.AddTask("clearUser", clearUserTk)
......
......@@ -13,7 +13,7 @@ func moveMessage() {
// moveMessage day at 5 am
moveMessageTk := toolbox.NewTask("moveMessage", "0 0 05 * * * ", func() error {
length := services.GetMessageRepositoryInstance().MoveMessageToHistory()
logs.Info("定时迁移了", length, "条消息记录到历史表~")
logs.Error("定时迁移了", length, "条消息记录到历史表~")
return nil
})
toolbox.AddTask("moveMessage", moveMessageTk)
......
......@@ -4,7 +4,7 @@ const dialog = electron.dialog;
const BrowserWindow = electron.BrowserWindow
const Menu = electron.Menu
const path = require('path')
if (process.mas) app.setName('客服系统')
if (process.mas) app.setName('玩车客服系统')
let mainWindow
function createWindow () {
......@@ -123,12 +123,7 @@ let template = [
{
label: '关于',
role: 'help',
submenu: [{
label: '客服',
click: function () {
electron.shell.openExternal('http://kf.aissz.com:666')
}
}]
submenu: []
}
]
......
{
"name": "kefu_admin",
"version": "0.0.1",
"version": "2.0.0",
"private": true,
"main": "main.js",
"scripts": {
......
......@@ -588,7 +588,6 @@ export default {
},
// 接收消息
receiveP2PMsg(message){
console.log(message)
var nowTime = parseInt((new Date().getTime() +"").substr(0, 10))
message.timestamp = parseInt((message.timestamp +"").substr(0, 10))
if(message.from_account == this.adminInfo.id && message.biz_type == "pong") return;
......
......@@ -2,6 +2,6 @@ module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
outputDir: '../../public/admin/',
devServer: {
proxy: 'http://localhost:8080',
proxy: 'http://im.cmp520.com',
}
}
......@@ -12,7 +12,7 @@ export default {
messages: [], // 消息列表
isLoadMorEnd: false, // 是否已经到末尾
userLocal: "", // 用户地理位置
AmapAPPKey: "", // 高德地图web appkey (请自行去高德地图申请)
AmapAPPKey: "73ef1dc5c5ea086e7330b95aede42953", // 高德地图web appkey
isLoadMorLoading: false, // 是否在加装更多消息loading
userInfo: {}, // 用户信息
companyInfo: null, // 公司信息
......
......@@ -124,7 +124,6 @@ export default {
}
}
}
.floting{
width 30px;
height 30px;
......@@ -136,6 +135,5 @@ export default {
right 10px
}
</style>
......@@ -2,6 +2,6 @@ module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
outputDir: '../../public/client/',
devServer: {
proxy: 'http://localhost:8080',
proxy: 'http://im.cmp520.com',
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment