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. 142
      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); User user = userMapper.selectById(userId);
if(user == null || ObjectUtil.isEmpty(user)){ // if(user == null || ObjectUtil.isEmpty(user)){
return false; // return false;
} // }
String token = user.getUniqueToken(); String token = user.getUniqueToken();
if(token == null || ObjectUtil.isEmpty(token)){ if(token == null || ObjectUtil.isEmpty(token)){

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

@ -15,9 +15,9 @@
点击下方文档了解详细信息: 点击下方文档了解详细信息:
</div> </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"> <<!-- a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明 盒子IM商业版付费说明
</a> </a> -->
</div> </div>
</body> </body>
</html> </html>

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

@ -15,9 +15,9 @@
点击下方文档了解详细信息: 点击下方文档了解详细信息:
</div> </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"> <!-- <a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明 盒子IM商业版付费说明
</a> </a> -->
</div> </div>
</body> </body>
</html> </html>

4
im-uniapp/manifest.json

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

2
im-uniapp/pages.json

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

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

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

2
im-web/.env.development

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

2
im-web/.env.production

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

2
im-web/public/index.html

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

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

@ -18,7 +18,7 @@
<div class="account-info"> <div class="account-info">
<div class="nick-name"> <div class="nick-name">
{{ currentUser.nickName }} {{ 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>
<div class="account-name">@{{ currentUser.userName }}</div> <div class="account-name">@{{ currentUser.userName }}</div>
</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 style="padding-top:50px; text-align: center;font-size: 16px;">
点击下方文档了解详细信息: 点击下方文档了解详细信息:
</div> </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"> <a href="https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29" target="_blank">
盒子IM商业版付费说明 盒子IM商业版付费说明
</a> </a>
</div> </div> -->
</div> </div>
</el-dialog> </el-dialog>

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

@ -515,6 +515,7 @@ export default {
this.configStore.setAppInit(false); this.configStore.setAppInit(false);
this.$wsApi.close(3000); this.$wsApi.close(3000);
sessionStorage.removeItem("accessToken"); sessionStorage.removeItem("accessToken");
localStorage.removeItem('switchable_accounts_cache');
location.href = "/"; 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"> <el-form :model="registerForm" status-icon :rules="rules" ref="registerForm" label-width="80px" class="content">
<div class="title"> <div class="title">
<img class="logo" src="../../public/logo.png" /> <img class="logo" src="../../public/logo.png" />
<div>欢迎成为盒子IM的用户</div> <div>欢迎</div>
</div> </div>
<el-form-item label="用户名" prop="userName"> <el-form-item label="用户名" prop="userName">
<el-input type="userName" v-model="registerForm.userName" autocomplete="off" placeholder="用户名(登录使用)" <el-input type="userName" v-model="registerForm.userName" autocomplete="off" placeholder="用户名(登录使用)"

Loading…
Cancel
Save