|
@@ -108,11 +108,11 @@ export default {
|
|
|
token: this.userToken,
|
|
token: this.userToken,
|
|
|
logLevel:6,
|
|
logLevel:6,
|
|
|
platformID: 5, // 使用配置的平台ID
|
|
platformID: 5, // 使用配置的平台ID
|
|
|
- apiAddr: 'https://web.im.cdwjyyh.com/api', // API地址
|
|
|
|
|
- wsAddr: 'wss://web.im.cdwjyyh.com/msg_gateway', // WebSocket地址
|
|
|
|
|
|
|
+ apiAddr: process.env.VUE_APP_API_ADDR,
|
|
|
|
|
+ wsAddr: process.env.VUE_APP_WS_ADDR,
|
|
|
dataDir: '/imdata' // 添加数据存储目录
|
|
dataDir: '/imdata' // 添加数据存储目录
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ console.log("config",config)
|
|
|
this.OpenIM.login(config).then(() => {
|
|
this.OpenIM.login(config).then(() => {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.checkSDKReadyState();
|
|
this.checkSDKReadyState();
|
|
@@ -187,7 +187,12 @@ export default {
|
|
|
this.$store.commit('updateConversationList', data)
|
|
this.$store.commit('updateConversationList', data)
|
|
|
})
|
|
})
|
|
|
.catch(({ errCode, errMsg }) => {
|
|
.catch(({ errCode, errMsg }) => {
|
|
|
- // 调用失败
|
|
|
|
|
|
|
+ if (errCode === 1004) {
|
|
|
|
|
+ console.log("暂无会话数据")
|
|
|
|
|
+ this.$store.commit('updateConversationList', [])
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error("获取会话列表失败", errCode, errMsg)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
//查询好友列表
|
|
//查询好友列表
|
|
|
this.OpenIM.getFriendListPage({ offset:0, count:100 })
|
|
this.OpenIM.getFriendListPage({ offset:0, count:100 })
|
|
@@ -198,7 +203,12 @@ export default {
|
|
|
this.$store.commit('updateFriendList', data)
|
|
this.$store.commit('updateFriendList', data)
|
|
|
})
|
|
})
|
|
|
.catch(({ errCode, errMsg }) => {
|
|
.catch(({ errCode, errMsg }) => {
|
|
|
- // 调用失败
|
|
|
|
|
|
|
+ if (errCode === 1004) {
|
|
|
|
|
+ console.log("暂无好友数据")
|
|
|
|
|
+ this.$store.commit('updateFriendList', [])
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error("获取好友列表失败", errCode, errMsg)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|