diff --git a/README.md b/README.md index ce65492..ba57576 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ 1. 盒子IM是一个仿微信实现的网页版聊天软件,不依赖任何第三方收费组件。 1. 支持私聊、群聊、离线消息、发送语音、图片、文件、已读未读、群@等功能 -1. 支持单人、多人音视频通话(基于原生webrtc实现,需要ssl证书) +1. 支持音视频通话(基于原生webrtc实现,需要ssl证书) 1. uniapp端兼容app、h5、微信小程序,可与web端同时在线,并保持消息同步 1. 后端采用springboot+netty实现,网页端使用vue,移动端使用uniapp 1. 服务器支持集群化部署,具有良好的横向扩展能力 @@ -28,7 +28,7 @@ 网页端:https://www.boxim.online -移动安卓端:https://www.boxim.online/download/boxim.apk +移动安卓端:已上架至各大主流手机应用市场以及腾讯应用宝,搜索"盒子IM",下载安装即可 移动ios端: 已上架至app store,搜索"盒子IM",下载安装即可 @@ -40,8 +40,9 @@ 说明: 1.**请勿利用测试账号辱骂他人、发布低俗内容,否则将直接对您的IP进行封禁** -2.由于微信小程序每次发布审核过于严苛和繁琐,暂时不再提供体验环境,但uniapp端依然会继续兼容小程序 -3.体验环境部署的是商业版本,与开源版本功能存在一定差异,具体请参考: +2.由于部分厂商上架审核要求实名制,app端隐藏了"用户名注册"注册通道,可通过长按注册页面蓝色文字标题解除限制 +3.由于微信小程序每次发布审核过于严苛和繁琐,暂时不再提供体验环境,但uniapp端依然会继续兼容小程序 +4.体验环境部署的是商业版本,与开源版本功能存在一定差异,具体请参考: https://www.yuque.com/u1475064/imk5n2/qtezcg32q1d0dr29#SbvXq @@ -109,7 +110,7 @@ https://www.yuque.com/u1475064/mufu2a/vn5u10ephxh9sau8 群聊: ![输入图片说明](%E6%88%AA%E5%9B%BE/web/%E7%BE%A4%E8%81%8A.jpg) -群通话: +群通话(商业版): ![输入图片说明](%E6%88%AA%E5%9B%BE/web/%E5%A4%9A%E4%BA%BA%E9%80%9A%E8%AF%9D.jpg) 好友列表: diff --git a/im-platform/src/main/java/com/bx/implatform/dto/RegisterDTO.java b/im-platform/src/main/java/com/bx/implatform/dto/RegisterDTO.java index f6998e9..37a0c51 100644 --- a/im-platform/src/main/java/com/bx/implatform/dto/RegisterDTO.java +++ b/im-platform/src/main/java/com/bx/implatform/dto/RegisterDTO.java @@ -20,7 +20,6 @@ public class RegisterDTO { private String password; @Length(max = 20, message = "昵称不能大于20字符") - @NotEmpty(message = "用户昵称不可为空") @Schema(description = "用户昵称") private String nickName; diff --git a/im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java b/im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java index 5e516f3..938dd07 100644 --- a/im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java +++ b/im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java @@ -1,5 +1,6 @@ package com.bx.implatform.service.impl; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -109,6 +110,10 @@ public class UserServiceImpl extends ServiceImpl implements Us @Override public void register(RegisterDTO dto) { + // 昵称默认跟用户名保持一致 + if(StrUtil.isEmpty(dto.getNickName())){ + dto.setUserName(dto.getUserName()); + } User user = this.findUserByUserName(dto.getUserName()); if(!dto.getUserName().equals(sensitiveFilterUtil.filter(dto.getUserName()))){ throw new GlobalException("用户名包含敏感字符"); diff --git a/im-uniapp/App.vue b/im-uniapp/App.vue index 6be74ca..df3332c 100644 --- a/im-uniapp/App.vue +++ b/im-uniapp/App.vue @@ -74,8 +74,10 @@ export default { wsApi.onClose((res) => { console.log("ws断开", res); // 重新连接 - this.reconnectWs(); - this.configStore.setAppInit(false); + if (!this.reconnecting) { + this.reconnectWs(); + this.configStore.setAppInit(false); + } }) }, loadStore() { @@ -496,7 +498,7 @@ uni-page-head { // #endif page { - background-color: $im-bg; + background: $im-bg-linear; } .tab-page { @@ -519,7 +521,7 @@ page { // #endif color: $im-text-color; - background-color: $im-bg; + background: $im-bg-linear; font-size: $im-font-size; font-family: $font-family; } @@ -542,7 +544,7 @@ page { // #endif color: $im-text-color; - background-color: $im-bg; + background: $im-bg-linear; font-size: $im-font-size; font-family: $font-family; } diff --git a/im-uniapp/common/wssocket.js b/im-uniapp/common/wssocket.js index 3f03c9f..4476b69 100644 --- a/im-uniapp/common/wssocket.js +++ b/im-uniapp/common/wssocket.js @@ -66,9 +66,7 @@ let connect = (wsurl, token) => { socketTask.onError((e) => { console.log("ws错误:",e) - close(); - isConnect = false; - closeCallBack && closeCallBack({ code: 1006 }); + close(1006); }) } @@ -97,6 +95,9 @@ let close = (code) => { complete: (res) => { console.log("关闭websocket连接"); isConnect = false; + if (code != 3099) { + closeCallBack && closeCallBack(res);s + } }, fail: (e) => { console.log("关闭websocket连接失败", e); diff --git a/im-uniapp/components/nav-bar/nav-bar.vue b/im-uniapp/components/nav-bar/nav-bar.vue index 71963ce..5ec1b65 100644 --- a/im-uniapp/components/nav-bar/nav-bar.vue +++ b/im-uniapp/components/nav-bar/nav-bar.vue @@ -73,8 +73,7 @@ export default { \ No newline at end of file diff --git a/im-uniapp/pages/register/register.vue b/im-uniapp/pages/register/register.vue index 163d4b4..d511311 100644 --- a/im-uniapp/pages/register/register.vue +++ b/im-uniapp/pages/register/register.vue @@ -1,88 +1,142 @@ + + diff --git a/im-web/src/components/friend/AddFriend.vue b/im-web/src/components/friend/AddFriend.vue index 902fc8b..8bb9a4c 100644 --- a/im-web/src/components/friend/AddFriend.vue +++ b/im-web/src/components/friend/AddFriend.vue @@ -21,7 +21,7 @@
用户名:{{ user.userName }}
- 添加 已添加 diff --git a/im-web/src/components/friend/FriendItem.vue b/im-web/src/components/friend/FriendItem.vue index 5ff8d26..1753391 100644 --- a/im-web/src/components/friend/FriendItem.vue +++ b/im-web/src/components/friend/FriendItem.vue @@ -74,9 +74,11 @@ export default { height: 50px; display: flex; position: relative; - padding: 5px 10px; align-items: center; white-space: nowrap; + border-radius: 10px; + margin: 0 3px; + padding: 5px 8px; cursor: pointer; &:hover { diff --git a/im-web/src/components/group/GroupItem.vue b/im-web/src/components/group/GroupItem.vue index c2caedd..4e8be7d 100644 --- a/im-web/src/components/group/GroupItem.vue +++ b/im-web/src/components/group/GroupItem.vue @@ -36,9 +36,9 @@ export default { height: 50px; display: flex; position: relative; - padding: 5px 10px; - align-items: center; - white-space: nowrap; + border-radius: 10px; + margin: 0 3px; + padding: 5px 8px; cursor: pointer; &:hover { diff --git a/im-web/src/components/group/GroupMemberItem.vue b/im-web/src/components/group/GroupMemberItem.vue index f4f3cb8..4d0a4c3 100644 --- a/im-web/src/components/group/GroupMemberItem.vue +++ b/im-web/src/components/group/GroupMemberItem.vue @@ -45,14 +45,16 @@ export default { align-items: center; white-space: nowrap; box-sizing: border-box; + border-radius: 5px; + margin: 0 1px; - &:hover { - background-color: var(--im-background-active); - } + &:hover { + background-color: var(--im-background-active); + } - &.active { - background-color: #eeeeee; - } + &.active { + background-color: var(--im-background-active-dark); + } .member-name { flex: 1; diff --git a/im-web/src/store/chatStore.js b/im-web/src/store/chatStore.js index 046d842..5a5d691 100644 --- a/im-web/src/store/chatStore.js +++ b/im-web/src/store/chatStore.js @@ -547,11 +547,14 @@ export default defineStore('chatStore', { } } } - // 正在发送中的消息可能没有id,只有tmpId - if (msgInfo.tmpId) { + // 正在发送中的临时消息可能没有id,只有tmpId + if (msgInfo.selfSend && msgInfo.tmpId) { for (let idx = chat.messages.length - 1; idx >= 0; idx--) { let m = chat.messages[idx]; - if (m.tmpId && msgInfo.tmpId == m.tmpId) { + if (!m.selfSend || !m.tmpId) { + continue; + } + if (msgInfo.tmpId == m.tmpId) { return m; } // 如果id比要查询的消息小,说明没有这条消息 diff --git a/im-web/src/store/configStore.js b/im-web/src/store/configStore.js index 86321c2..445d904 100644 --- a/im-web/src/store/configStore.js +++ b/im-web/src/store/configStore.js @@ -5,6 +5,7 @@ export default defineStore('configStore', { state: () => { return { appInit: false, // 应用是否完成初始化 + fullScreen: true, // 当前是否全屏 webrtc: {} } }, @@ -15,6 +16,9 @@ export default defineStore('configStore', { setAppInit(appInit) { this.appInit = appInit; }, + setFullScreen(fullScreen) { + this.fullScreen = fullScreen; + }, loadConfig() { return new Promise((resolve, reject) => { http({ diff --git a/im-web/src/view/Chat.vue b/im-web/src/view/Chat.vue index 8ce5808..25547b8 100644 --- a/im-web/src/view/Chat.vue +++ b/im-web/src/view/Chat.vue @@ -1,6 +1,6 @@