feat: 优化im 接口403判定,新增从买家端以及卖家端进行跳转im权限判定,新增im掉线重连以及重连成功提醒,新增发送的消息断线将会进行重新发送消息提示,优化最近浏览 订单列表空展示。注释部分im打印的日志信息

This commit is contained in:
学习很差啦
2023-03-01 14:59:54 +08:00
parent 32b29f45e7
commit 4700bc995a
16 changed files with 288 additions and 153 deletions

View File

@@ -21,11 +21,15 @@ export default {
float: "",
},
],
webSocketWithOut:false, // ws 是否是掉线 无输出状态
// 对话索引(聊天对话的唯一索引)
index_name: null,
},
mutations: {
// 设置ws状态
SET_WS_STATUS: (state,resource) =>{
state.webSocketWithOut = resource
},
// 更新对话
UPDATE_DIALOGUE_MESSAGE (state, resource) {
state.records = [];
@@ -56,6 +60,8 @@ export default {
// 推送对话记录
PUSH_DIALOGUE (state, record) {
record = {...record,webSocketStatus:state.webSocketWithOut}
console.log("推送对话",)
state.records.push(record);
},

View File

@@ -37,6 +37,7 @@ const Talk = {
talkNum: (state) => state.items.length,
},
mutations: {
// 设置对话列表
SET_TALK_ITEMS (state, resource) {
Vue.set(state, 'items', resource.items)

View File

@@ -19,7 +19,6 @@ let state = {
// 判断用户是否登录
if (getToken()) {
let userInfo = getUserInfo();
console.error(userInfo)
state.name = userInfo.name;
state.id = userInfo.id;
state.face = userInfo.face ? userInfo.face : state.avatar;

View File

@@ -4,8 +4,6 @@ const defaultAvatar = require('@/assets/image/detault-avatar.jpg')
const state = {
socketStatus: false,
website_name: process.env.VUE_APP_WEBSITE_NAME,
copyright: `©2020 - 2021 ${process.env.VUE_APP_WEBSITE_NAME} 在线聊天 <a href="https://github.com/gzydong/LumenIM" style="color: #777272;font-weight: 400;" target="_blank">Github源码</a>`,
// 头像加载失败后的默认头像
defaultAvatar: "this.src='" + defaultAvatar + "'",
}