Commit b1be2a69 by keith

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

parent 36497b1f
...@@ -32,9 +32,9 @@ function createWindow () { ...@@ -32,9 +32,9 @@ function createWindow () {
message: "您确定关闭应用程序吗?", message: "您确定关闭应用程序吗?",
buttons: ['我点错了', '窗口最小化', '确定关闭'] buttons: ['我点错了', '窗口最小化', '确定关闭']
} }
dialog.showMessageBox(options, function (index) { dialog.showMessageBox(options).then(function (res) {
if(index == 2) app.exit(); if(res.response == 2) app.exit();
if(index == 1) mainWindow.minimize() if(res.response == 1) mainWindow.minimize()
}) })
e.preventDefault() e.preventDefault()
}) })
......
...@@ -278,6 +278,9 @@ export default { ...@@ -278,6 +278,9 @@ export default {
// 粘贴事件 // 粘贴事件
document.addEventListener("paste", this.inputPaste, false) document.addEventListener("paste", this.inputPaste, false)
// 3秒请求一次会话列表(避免后台推送不到不能及时更新)
setTimeout(()=> this.$store.dispatch('ON_GET_CONTACTS'), 3000)
}, },
beforeDestroy(){ beforeDestroy(){
document.removeEventListener("mousemove", this.onMousemoveEvent, false) document.removeEventListener("mousemove", this.onMousemoveEvent, false)
......
...@@ -101,7 +101,10 @@ func MessageInto(message models.Message) { ...@@ -101,7 +101,10 @@ func MessageInto(message models.Message) {
// 接收者是客服就推送 // 接收者是客服就推送
if admin != nil { if admin != nil {
go func() {
time.Sleep(1 * time.Second)
PushNewContacts(message.ToAccount) PushNewContacts(message.ToAccount)
}()
} }
} }
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