【新增】 IM基础模块
This commit is contained in:
37
public/im.js
37
public/im.js
@@ -1,37 +0,0 @@
|
||||
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 融云im
|
||||
*/
|
||||
|
||||
|
||||
import {
|
||||
init,
|
||||
connect,
|
||||
addConnectionStatusListener,
|
||||
addReceiveMessageListener
|
||||
} from '@rongcloud/imlib-uni'
|
||||
|
||||
export default {
|
||||
// 初始化
|
||||
imInit(){
|
||||
init('lmxuhwaglu76d')
|
||||
connect('token', res => {
|
||||
console.log(res)
|
||||
})
|
||||
this.imMonitor()
|
||||
},
|
||||
// 监听器
|
||||
imMonitor(){
|
||||
// 添加连接状态监听函数
|
||||
addConnectionStatusListener(res => {
|
||||
console.log(res.data)
|
||||
})
|
||||
// 添加消息监听函数
|
||||
addReceiveMessageListener(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user