链接登录退出

This commit is contained in:
2020-08-18 15:08:42 +08:00
parent 43e09e977d
commit cb95d1ead1
6 changed files with 46 additions and 59 deletions

View File

@@ -417,32 +417,13 @@ export default {
// that.list= res.data.data
}
})
//当前用户
var currentUser = {}
if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info');
currentUser = {
id : user.member.member_id,
nickname : user.member.member_nickname,
avatar: user.member.member_avatar
};
}else{
const user = uni.getStorageSync('morenimg');
currentUser = {
id : new Date().getTime(),
nickname : "123",
avatar: user
};
}
var room = {
id : a.rid + "",
name : a.rid + ""
};
that.chatRoomService = getApp().globalData.im
console.log(room,currentUser)
//构造chatRoomService
that.chatRoomService.subscribeRoomMessage(room,currentUser)
that.chatRoomService.subscribeRoomMessage(room)
//获取当前聊天室数据
that.room = that.chatRoomService.room;
that.chatRoomService.initialWhenOnlineUserChange(that.newpeople)