修复链接失败

This commit is contained in:
luyuan 2020-08-17 09:44:47 +08:00
parent 33e8942180
commit 3be650b24e
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

View File

@ -273,7 +273,7 @@ import chatVue from '../../pageD/chat/chat.vue'
// this.isNewmembervoucher(); // this.isNewmembervoucher();
// } // }
}, },
onLoad(){ async onLoad(){
this.getSwiper(); this.getSwiper();
// //
if(this.$store.state.hasLogin){ if(this.$store.state.hasLogin){
@ -281,23 +281,27 @@ import chatVue from '../../pageD/chat/chat.vue'
const user = uni.getStorageSync('user_info'); const user = uni.getStorageSync('user_info');
// console.log(user) // console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar) this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
this.imService.connectIM() await this.imService.connectIM()
}else{ }else{
this.$u.api.getDefaultAvatar().then((res)=>{ await this.$u.api.getDefaultAvatar().then((res)=>{
console.log(res) console.log(res)
uni.setStorageSync("morenimg",res.data.avatar) uni.setStorageSync("morenimg",res.data.avatar)
this.imService.login(new Date().getTime(),"123",res.data.avatar) this.imService.login(new Date().getTime(),"123",res.data.avatar)
this.imService.connectIM() console.log("用户信息")
}) })
console.log("链接")
await this.imService.connectIM()
} }
console.log("1212")
let that = this let that = this
setTimeout(function(){ setTimeout(function(){
that.imService.disconnect() that.imService.disconnect()
// console.log("guanbi") console.log("guanbi")
},1000) },1000)
setTimeout(function(){ setTimeout(function(){
// console.log("lianjie") console.log("lianjie")
that.imService.connectIM() that.imService.connectIM()
},2000) },2000)
}, },