Browse Source

修改账号缓存问题、常见问题回答问题

master
[yxf] 4 weeks ago
parent
commit
71e612b525
  1. 6
      im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java
  2. 4
      im-uniapp/hybrid/html/rtc-group/index.html
  3. 4
      im-uniapp/hybrid/html/rtc-private/index.html
  4. 4
      im-uniapp/manifest.json
  5. 2
      im-uniapp/pages.json
  6. 158
      im-uniapp/pages/chat/chat-box.vue
  7. 2
      im-web/.env.development
  8. 2
      im-web/.env.production
  9. 2
      im-web/public/index.html
  10. 2
      im-web/src/components/account/AccountSwitchMenu.vue
  11. 4
      im-web/src/components/rtc/RtcGroupVideo.vue
  12. 1
      im-web/src/view/Home.vue
  13. 2
      im-web/src/view/Register.vue

6
im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java

@ -50,9 +50,9 @@ public class ImAgentServiceImpl extends ServiceImpl<ImAgentMapper, ImAgent> impl
}
User user = userMapper.selectById(userId);
if(user == null || ObjectUtil.isEmpty(user)){
return false;
}
// if(user == null || ObjectUtil.isEmpty(user)){
// return false;
// }
String token = user.getUniqueToken();
if(token == null || ObjectUtil.isEmpty(token)){

4
im-uniapp/hybrid/html/rtc-group/index.html

@ -15,9 +15,9 @@
点击下方文档了解详细信息:
</div>
<div style="padding-top:10px; text-align: center;font-size: 16px;">
<a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
<<!-- a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明
</a>
</a> -->
</div>
</body>
</html>

4
im-uniapp/hybrid/html/rtc-private/index.html

@ -15,9 +15,9 @@
点击下方文档了解详细信息:
</div>
<div style="padding-top:10px; text-align: center;font-size: 16px;">
<a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
<!-- <a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明
</a>
</a> -->
</div>
</body>
</html>

4
im-uniapp/manifest.json

@ -1,5 +1,5 @@
{
"name" : "盒子IM",
"name" : "客服聊天",
"appid" : "__UNI__69DD57A",
"description" : "",
"versionName" : "3.10.0",
@ -126,7 +126,7 @@
},
"vueVersion" : "3",
"h5" : {
"title" : "盒子IM",
"title" : "客服聊天",
"router" : {
"base" : "/h5/"
}

2
im-uniapp/pages.json

@ -74,7 +74,7 @@
// }
],
"globalStyle": {
"navigationBarTitleText": "盒子IM",
"navigationBarTitleText": "客服聊天",
"navigationBarTextStyle": "black",
/* #ifndef MP-WEIXIN */
"navigationStyle": "custom",

158
im-uniapp/pages/chat/chat-box.vue

@ -323,113 +323,95 @@ export default {
(item) => item.replyTitle === replyTitle
);
if (!autoReply) return;
if (this.isBanned) {
this.showBannedTip();
return;
}
let userMsgInfo = {
tmpId: this.generateId(),
type: this.$enums.MESSAGE_TYPE.TEXT,
content: autoReply.replyTitle,
receipt: this.isReceipt
receipt: this.isReceipt,
selfSend: true,
sendId: this.mine.id,
sendTime: new Date().getTime(),
status: this.$enums.MESSAGE_STATUS.SENDED,
};
this.fillTargetId(userMsgInfo, this.chat.targetId);
const chat = this.chat;
if (!chat) return;
let tmpUserMessage = this.buildTmpMessage(userMsgInfo);
tmpUserMessage.status = this.$enums.MESSAGE_STATUS.SENDED;
this.chatStore.insertMessage(tmpUserMessage, chat);
this.moveChatToTop();
this.sendMessageRequest(userMsgInfo)
.then((m) => {
tmpUserMessage = JSON.parse(JSON.stringify(tmpUserMessage));
tmpUserMessage.id = m.id;
tmpUserMessage.status = m.status;
this.chatStore.updateMessage(tmpUserMessage, chat);
this.triggerAutoReply(autoReply);
this.scrollToBottom();
this.isReceipt = false;
})
.catch(() => {
tmpUserMessage = JSON.parse(JSON.stringify(tmpUserMessage));
tmpUserMessage.status = this.$enums.MESSAGE_STATUS.FAILED;
this.chatStore.updateMessage(tmpUserMessage, chat);
});
this.triggerAutoReply(autoReply);
this.scrollToBottom();
this.isReceipt = false;
},
triggerAutoReply(autoReply) {
let tmpId = this.generateId();
let replyMsgInfo = {
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
type: autoReply.replyType,
receipt: false
};
if (autoReply.replyType === 0) {
replyMsgInfo.content = autoReply.replyContent;
} else if (autoReply.replyType === 1) {
replyMsgInfo.content = JSON.stringify({
originUrl: autoReply.replyContent,
thumbUrl: autoReply.replyContent,
});
}
let typingMessage = {
id: this.generateId(),
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
selfSend: false,
sendTime: new Date().getTime(),
type: this.$enums.MESSAGE_TYPE.TIP_TEXT,
content: this.$t('chat.typing'),
status: this.$enums.MESSAGE_STATUS.SENDING
};
this.chatStore.insertMessage(typingMessage, this.chat);
this.$http({
url: "/message/private/send",
method: "post",
data: replyMsgInfo
}).then(res => {
this.chatStore.deleteMessage(typingMessage, this.chat);
if (res && res.id) {
let replyMessage = {
id: res.id,
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
selfSend: false,
sendTime: new Date().getTime(),
type: autoReply.replyType,
content: replyMsgInfo.content,
status: this.$enums.MESSAGE_STATUS.SENDED
};
this.chatStore.insertMessage(replyMessage, this.chat);
this.scrollToBottom();
}
}).catch(err => {
console.error("自动回复发送失败", err);
this.chatStore.deleteMessage(typingMessage, this.chat);
uni.showToast({
title: this.$t('chat.autoReplyFailed'),
icon: "none"
});
});
},
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
type: autoReply.replyType,
receipt: false,
selfSend: false,
sendTime: new Date().getTime(),
status: this.$enums.MESSAGE_STATUS.SENDED,
};
if (autoReply.replyType === 0) {
replyMsgInfo.content = autoReply.replyContent;
} else if (autoReply.replyType === 1) {
replyMsgInfo.content = JSON.stringify({
originUrl: autoReply.replyContent,
thumbUrl: autoReply.replyContent,
});
}
let typingMessage = {
id: this.generateId(),
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
selfSend: false,
sendTime: new Date().getTime(),
type: this.$enums.MESSAGE_TYPE.TIP_TEXT,
content: this.$t('chat.typing'),
status: this.$enums.MESSAGE_STATUS.SENDING
};
this.chatStore.insertMessage(typingMessage, this.chat);
this.chatStore.deleteMessage(typingMessage, this.chat);
let replyMessage = {
id: this.generateId(),
tmpId: tmpId,
sendId: this.chat.targetId,
recvId: this.mine.id,
selfSend: false,
sendTime: new Date().getTime(),
type: autoReply.replyType,
content: replyMsgInfo.content,
status: this.$enums.MESSAGE_STATUS.SENDED,
};
if (this.isGroup) {
replyMessage.groupId = this.chat.targetId;
replyMessage.readedCount = 0;
}
this.chatStore.insertMessage(replyMessage, this.chat);
this.scrollToBottom();
},
onRecorderInput() {
this.showRecord = true;

2
im-web/.env.development

@ -1,7 +1,7 @@
ENV = 'development'
# app名称
VUE_APP_NAME = "盒子IM"
VUE_APP_NAME = "客服登录平台"
# 接口请求地址
VUE_APP_BASE_API = '/api'
# ws地址

2
im-web/.env.production

@ -1,7 +1,7 @@
ENV = 'production'
# app名称
VUE_APP_NAME = "盒子IM"
VUE_APP_NAME = "客服登录平台"
# 接口地址
VUE_APP_BASE_API = 'https://www.boxim.online/api'
# ws地址

2
im-web/public/index.html

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title>盒子IM</title>
<title>客服登录平台</title>
</head>
<body>
<div id="app"></div>

2
im-web/src/components/account/AccountSwitchMenu.vue

@ -18,7 +18,7 @@
<div class="account-info">
<div class="nick-name">
{{ currentUser.nickName }}
<el-tag type="success" size="mini" class="role-tag">客服</el-tag>
<!-- <el-tag type="success" size="mini" class="role-tag">客服</el-tag> -->
</div>
<div class="account-name">@{{ currentUser.userName }}</div>
</div>

4
im-web/src/components/rtc/RtcGroupVideo.vue

@ -8,11 +8,11 @@
<div style="padding-top:50px; text-align: center;font-size: 16px;">
点击下方文档了解详细信息:
</div>
<div style="padding-top:10px; text-align: center;font-size: 16px;">
<!-- <div style="padding-top:10px; text-align: center;font-size: 16px;">
<a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明
</a>
</div>
</div> -->
</div>
</el-dialog>

1
im-web/src/view/Home.vue

@ -515,6 +515,7 @@ export default {
this.configStore.setAppInit(false);
this.$wsApi.close(3000);
sessionStorage.removeItem("accessToken");
localStorage.removeItem('switchable_accounts_cache');
location.href = "/";
},

2
im-web/src/view/Register.vue

@ -6,7 +6,7 @@
<el-form :model="registerForm" status-icon :rules="rules" ref="registerForm" label-width="80px" class="content">
<div class="title">
<img class="logo" src="../../public/logo.png" />
<div>欢迎成为盒子IM的用户</div>
<div>欢迎</div>
</div>
<el-form-item label="用户名" prop="userName">
<el-input type="userName" v-model="registerForm.userName" autocomplete="off" placeholder="用户名(登录使用)"

Loading…
Cancel
Save