diff --git a/im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java b/im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java index e0ba100..8be900e 100644 --- a/im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java +++ b/im-platform/src/main/java/com/bx/implatform/service/impl/ImAgentServiceImpl.java @@ -50,9 +50,9 @@ public class ImAgentServiceImpl extends ServiceImpl 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)){ diff --git a/im-uniapp/hybrid/html/rtc-group/index.html b/im-uniapp/hybrid/html/rtc-group/index.html index dc38d0f..76deca1 100644 --- a/im-uniapp/hybrid/html/rtc-group/index.html +++ b/im-uniapp/hybrid/html/rtc-group/index.html @@ -15,9 +15,9 @@ 点击下方文档了解详细信息:
- + <
\ No newline at end of file diff --git a/im-uniapp/hybrid/html/rtc-private/index.html b/im-uniapp/hybrid/html/rtc-private/index.html index 6ebde9b..10f07a5 100644 --- a/im-uniapp/hybrid/html/rtc-private/index.html +++ b/im-uniapp/hybrid/html/rtc-private/index.html @@ -15,9 +15,9 @@ 点击下方文档了解详细信息:
- +
\ No newline at end of file diff --git a/im-uniapp/manifest.json b/im-uniapp/manifest.json index 213d246..184af49 100644 --- a/im-uniapp/manifest.json +++ b/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/" } diff --git a/im-uniapp/pages.json b/im-uniapp/pages.json index 72f4341..41f077c 100644 --- a/im-uniapp/pages.json +++ b/im-uniapp/pages.json @@ -74,7 +74,7 @@ // } ], "globalStyle": { - "navigationBarTitleText": "盒子IM", + "navigationBarTitleText": "客服聊天", "navigationBarTextStyle": "black", /* #ifndef MP-WEIXIN */ "navigationStyle": "custom", diff --git a/im-uniapp/pages/chat/chat-box.vue b/im-uniapp/pages/chat/chat-box.vue index 0e348ba..d059dbb 100644 --- a/im-uniapp/pages/chat/chat-box.vue +++ b/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; diff --git a/im-web/.env.development b/im-web/.env.development index 9762bd8..7de2b92 100644 --- a/im-web/.env.development +++ b/im-web/.env.development @@ -1,7 +1,7 @@ ENV = 'development' # app名称 -VUE_APP_NAME = "盒子IM" +VUE_APP_NAME = "客服登录平台" # 接口请求地址 VUE_APP_BASE_API = '/api' # ws地址 diff --git a/im-web/.env.production b/im-web/.env.production index ffdb954..aba9090 100644 --- a/im-web/.env.production +++ b/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地址 diff --git a/im-web/public/index.html b/im-web/public/index.html index 36eb88e..c123ab9 100644 --- a/im-web/public/index.html +++ b/im-web/public/index.html @@ -5,7 +5,7 @@ - 盒子IM + 客服登录平台
diff --git a/im-web/src/components/account/AccountSwitchMenu.vue b/im-web/src/components/account/AccountSwitchMenu.vue index c46230e..ece44a2 100644 --- a/im-web/src/components/account/AccountSwitchMenu.vue +++ b/im-web/src/components/account/AccountSwitchMenu.vue @@ -18,7 +18,7 @@ diff --git a/im-web/src/components/rtc/RtcGroupVideo.vue b/im-web/src/components/rtc/RtcGroupVideo.vue index 644ad5c..1e92ed1 100644 --- a/im-web/src/components/rtc/RtcGroupVideo.vue +++ b/im-web/src/components/rtc/RtcGroupVideo.vue @@ -8,11 +8,11 @@
点击下方文档了解详细信息:
-
+
diff --git a/im-web/src/view/Home.vue b/im-web/src/view/Home.vue index a7f447a..651ad50 100644 --- a/im-web/src/view/Home.vue +++ b/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 = "/"; }, diff --git a/im-web/src/view/Register.vue b/im-web/src/view/Register.vue index bffbefe..84d91e5 100644 --- a/im-web/src/view/Register.vue +++ b/im-web/src/view/Register.vue @@ -6,7 +6,7 @@
-
欢迎成为盒子IM的用户
+
欢迎