From 9d9c0cdaf89f5e467ce4e41d4c725b52e89e5a12 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 24 Feb 2022 17:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=88=B7=E6=96=B0=E4=BC=9A=E8=AF=9D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 3 ++- utils/im/index.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 36108b7..5b16def 100644 --- a/main.js +++ b/main.js @@ -40,11 +40,12 @@ usqlite.connect({ fail: () => { contactModel.create((err, res) => { console.error('SQLITE 创建表格', err, res) + uni.setStorageSync('FIRST_RUN', 'X') }) } }) }) - + App.mpType = 'app' const app = new Vue({ store, diff --git a/utils/im/index.js b/utils/im/index.js index 3c66184..f22b319 100644 --- a/utils/im/index.js +++ b/utils/im/index.js @@ -22,7 +22,9 @@ const initIm = (KEY) => { if (store.getters.getToken !== '') { getImToken().then(res => { connect(res.token, res.userInfo, (res) => { - console.log('IM.CONNECT', res); + console.log('IM.CONNECT', res); + // 发布全局事件,有新消息,刷新会话列表 + uni.$emit('onReceiveMessage') }) }) }