onUnload: function () {
let onMessageReceived = function(res){
console.log(res,'取消监听')
}
let onSdkReady = function(res){
console.log(res,'取消监听')
}
tim.off(TIM.EVENT.SDK_READY, onSdkReady);
tim.off(TIM.EVENT.MESSAGE_RECEIVED, onMessageReceived)
let promise = tim.logout()
promise.then(function(imResponse) {
console.log(imResponse,'退出成功')
}).catch(function(imError) {
console.warn('logout error:', imError);
})
},
相似问题