JIM is not defined;at pages/record/record page lifeCycleMethod onLoad function
ReferenceError: JIM is not defined
/**
* --
*/
onLoad: function (option) {
wx.showLoading({
title: "",
mask: true
});
//
JIM.login({
"username": app.userIMinfo.username,
"password": app.userIMinfo.password,
"is_md5": true
}).onSuccess(function (data) {
console.log(data)
wx.hideLoading();
//
JIM.onMsgReceive(function (data) {
console.log(data)
if (data.messages.length >= 1) {
//userMsg
let msgBox = that.data.userMsg
msgBox = msgBox.concat(data.messages)
that.setData({
userMsg: msgBox
})
//msgBos
wx.setStorage({
key: option.id,
data: msgBox
})
}
});
//
JIM.onSyncConversation(function (data) {
console.log(data)
let msgBox = that.data.userMsg
msgBox = msgBox.concat(data.messages)
that.setData({
userMsg: msgBox
})
wx.setStorage({
key: option.id,
data: msgBox
})
});
}).onFail(function (data) {
console.log(data)
wx.showToast({
title: "",
icon: "fail",
duration: 1500
})
})
},