Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

杨树贤 / kefu_server

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit b1be2a69 authored 5 years ago by keith's avatar keith
Browse files
Options
  • _('Browse Files')
  • Download
  • Email Patches
  • Plain Diff

客户端增加定时获取会话列表,避免服务端推送不到

parent 36497b1f
Hide whitespace changes
Inline Side-by-side
Showing with 10 additions and 4 deletions
  • ui/kefu_admin/main.js
  • ui/kefu_admin/src/views/workbench/index.vue
  • utils/message_into.go
ui/kefu_admin/main.js
View file @ b1be2a69
......@@ -32,9 +32,9 @@ function createWindow () {
message: "您确定关闭应用程序吗?",
buttons: ['我点错了', '窗口最小化', '确定关闭']
}
dialog.showMessageBox(options, function (index) {
if(index == 2) app.exit();
if(index == 1) mainWindow.minimize()
dialog.showMessageBox(options).then(function (res) {
if(res.response == 2) app.exit();
if(res.response == 1) mainWindow.minimize()
})
e.preventDefault()
})
......
This diff is collapsed. Click to expand it.
ui/kefu_admin/src/views/workbench/index.vue
View file @ b1be2a69
......@@ -278,6 +278,9 @@ export default {
// 粘贴事件
document.addEventListener("paste", this.inputPaste, false)
// 3秒请求一次会话列表(避免后台推送不到不能及时更新)
setTimeout(()=> this.$store.dispatch('ON_GET_CONTACTS'), 3000)
},
beforeDestroy(){
document.removeEventListener("mousemove", this.onMousemoveEvent, false)
......
This diff is collapsed. Click to expand it.
utils/message_into.go
View file @ b1be2a69
......@@ -101,7 +101,10 @@ func MessageInto(message models.Message) {
// 接收者是客服就推送
if admin != nil {
PushNewContacts(message.ToAccount)
go func() {
time.Sleep(1 * time.Second)
PushNewContacts(message.ToAccount)
}()
}
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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