添加了退出登录 #69
@ -48,6 +48,7 @@ export default {
|
|||||||
// 退出登陆
|
// 退出登陆
|
||||||
loginout(){
|
loginout(){
|
||||||
uni.clearStorage();
|
uni.clearStorage();
|
||||||
|
this.imService.disconnect()
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "退出登陆成功!",
|
title: "退出登陆成功!",
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
<text>内容管理</text>
|
<text>内容管理</text>
|
||||||
<image src="/static/image/user/1.png"></image>
|
<image src="/static/image/user/1.png"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="nav" @click="loginout()">
|
||||||
|
<text>退出登录</text>
|
||||||
|
<image src="/static/image/user/1.png"></image>
|
||||||
|
</view>
|
||||||
<view class="release-btn" @click="publish">
|
<view class="release-btn" @click="publish">
|
||||||
<image src="../../static/image/index/publish.png"></image>
|
<image src="../../static/image/index/publish.png"></image>
|
||||||
<view class="text">发布</view>
|
<view class="text">发布</view>
|
||||||
@ -64,6 +68,18 @@ export default {
|
|||||||
this.imService.connectIM()
|
this.imService.connectIM()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
loginout(){
|
||||||
|
this.imService.disconnect()
|
||||||
|
uni.clearStorage();
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "退出登陆成功!",
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
uni.reLaunch({
|
||||||
|
url:"../login/login"
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
// 获取个人信息
|
// 获取个人信息
|
||||||
getmyinfo(){
|
getmyinfo(){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -226,7 +226,6 @@ IMService.prototype.connectIM = function () {
|
|||||||
this.subscribeFriendsPresence();
|
this.subscribeFriendsPresence();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log('连接失败,请确保网络正常,appkey和host正确,code:' + error.code + " content:" + error.content);
|
console.log('连接失败,请确保网络正常,appkey和host正确,code:' + error.code + " content:" + error.content);
|
||||||
this.connectIM()
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(12323)
|
console.log(12323)
|
||||||
|
Loading…
Reference in New Issue
Block a user