|
|
@@ -645,5 +645,25 @@ module.exports = {
|
|
|
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ sendImMessage(userId,content,messageType,chatConversationId){
|
|
|
+ let data = {
|
|
|
+ userId,
|
|
|
+ content,
|
|
|
+ messageType,
|
|
|
+ chatConversationId
|
|
|
+ }
|
|
|
+ data = JSON.stringify(data);
|
|
|
+ return new Promise(async (resolve,reject) => {
|
|
|
+ uni.sendSocketMessage({
|
|
|
+ data: data,
|
|
|
+ success(res) {
|
|
|
+ resolve(res)
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ reject(err);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
};
|