From 9361f5bffeaed594c49a80341e43289335f84485 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 22 Aug 2020 16:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E9=80=80=E5=87=BA?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/user/index.vue | 1 + pages/user/myinfo.vue | 16 ++++++++++++++++ static/imservice.js | 1 - 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pages/user/index.vue b/pages/user/index.vue index 035e58e..6294cbe 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -48,6 +48,7 @@ export default { // 退出登陆 loginout(){ uni.clearStorage(); + this.imService.disconnect() this.$refs.uToast.show({ title: "退出登陆成功!", type: 'success' diff --git a/pages/user/myinfo.vue b/pages/user/myinfo.vue index 5d461ae..a9d34d2 100644 --- a/pages/user/myinfo.vue +++ b/pages/user/myinfo.vue @@ -19,6 +19,10 @@ 内容管理 + + 退出登录 + + 发布 @@ -64,6 +68,18 @@ export default { this.imService.connectIM() }, methods: { + loginout(){ + this.imService.disconnect() + uni.clearStorage(); + this.$refs.uToast.show({ + title: "退出登陆成功!", + type: 'success' + }); + uni.reLaunch({ + url:"../login/login" + }) + + }, // 获取个人信息 getmyinfo(){ let that = this; diff --git a/static/imservice.js b/static/imservice.js index 7be8708..297a33d 100644 --- a/static/imservice.js +++ b/static/imservice.js @@ -226,7 +226,6 @@ IMService.prototype.connectIM = function () { this.subscribeFriendsPresence(); }).catch(error => { console.log('连接失败,请确保网络正常,appkey和host正确,code:' + error.code + " content:" + error.content); - this.connectIM() }); } catch (error) { console.log(12323)