Parcourir la source

补充公告信息

xie.bx il y a 2 ans
Parent
commit
7543047e0b

+ 0 - 6
im-platform/src/main/java/com/bx/implatform/controller/UserController.java

@@ -28,12 +28,6 @@ public class UserController {
     private IUserService userService;
 
 
-    @GetMapping("/online")
-    @ApiOperation(value = "判断用户是否在线",notes="返回在线的用户id集合")
-    public Result checkOnline(@NotEmpty @RequestParam("userIds") String userIds){
-        List<Long> onlineIds = userService.checkOnline(userIds);
-        return ResultUtils.success(onlineIds);
-    }
 
     @GetMapping("/terminal/online")
     @ApiOperation(value = "判断用户哪个终端在线",notes="返回在线的用户id的终端集合")

+ 0 - 2
im-platform/src/main/java/com/bx/implatform/service/IUserService.java

@@ -30,8 +30,6 @@ public interface IUserService extends IService<User> {
 
     List<UserVO> findUserByName(String name);
 
-    List<Long> checkOnline(String userIds);
-
     List<OnlineTerminalVO> getOnlineTerminals(String userIds);
 
 

+ 1 - 1
im-platform/src/main/java/com/bx/implatform/service/impl/GroupMessageServiceImpl.java

@@ -198,7 +198,7 @@ public class GroupMessageServiceImpl extends ServiceImpl<GroupMessageMapper, Gro
         List<GroupMember> members = groupMemberService.findByUserId(session.getUserId());
         List<Long> ids = members.stream().map(GroupMember::getGroupId).collect(Collectors.toList());
         // 只能拉取最近3个月的
-        Date minDate = DateTimeUtils.addMonths(new Date(), -1);
+        Date minDate = DateTimeUtils.addMonths(new Date(), -3);
         LambdaQueryWrapper<GroupMessage> wrapper = Wrappers.lambdaQuery();
         wrapper.gt(GroupMessage::getId, minId)
                 .gt(GroupMessage::getSendTime, minDate)

+ 1 - 1
im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java

@@ -205,7 +205,7 @@ public class PrivateMessageServiceImpl extends ServiceImpl<PrivateMessageMapper,
         // 获取当前用户的消息
         LambdaQueryWrapper<PrivateMessage> queryWrapper = Wrappers.lambdaQuery();
         // 只能拉取最近6个月的
-        Date minDate = DateTimeUtils.addMonths(new Date(), -1);
+        Date minDate = DateTimeUtils.addMonths(new Date(), -3);
         queryWrapper.gt(PrivateMessage::getId, minId)
                 .ge(PrivateMessage::getSendTime, minDate)
                 .ne(PrivateMessage::getStatus, MessageStatus.RECALL.code())

+ 0 - 12
im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java

@@ -246,18 +246,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         }).collect(Collectors.toList());
     }
 
-    /**
-     * 判断用户是否在线,返回在线的用户id列表
-     *
-     * @param userIds 用户id,多个用‘,’分割
-     * @return 在线用户id列表
-     */
-    @Override
-    public List<Long> checkOnline(String userIds) {
-        List<Long> userIdList = Arrays.stream(userIds.split(","))
-            .map(Long::parseLong).collect(Collectors.toList());
-        return imClient.getOnlineUser(userIdList);
-    }
 
 
     /**

+ 4 - 6
im-ui/src/components/chat/ChatBox.vue

@@ -242,16 +242,12 @@
 				this.showMinIdx = this.showMinIdx > 10 ? this.showMinIdx - 10 : 0;
 			},
 			handleScroll(e) {
-			
 				let scrollElement = e.target
 				let scrollTop = scrollElement.scrollTop
-				if (scrollTop <30 ) { // 在顶部,不滚动的情况
-					console.log("next")
+				if (scrollTop < 30 ) { // 在顶部,不滚动的情况
 					// 多展示20条信息
 					this.showMinIdx = this.showMinIdx > 20 ? this.showMinIdx - 20 : 0;
-	
 				}
-				
 			},
 			switchEmotionBox() {
 				this.showEmotion = !this.showEmotion;
@@ -508,14 +504,16 @@
 				handler(newChat, oldChat) {
 					if (newChat.targetId > 0 && (!oldChat || newChat.type != oldChat.type ||
 							newChat.targetId != oldChat.targetId)) {
-
 						if (this.chat.type == "GROUP") {
 							this.loadGroup(this.chat.targetId);
 						} else {
 							this.loadFriend(this.chat.targetId);
 						}
+						// 滚到底部
 						this.scrollToBottom();
 						this.sendText = "";
+						// 消息已读
+						this.readedMessage()
 						// 初始状态只显示30条消息
 						let size = this.chat.messages.length;
 						this.showMinIdx = size > 30 ? size - 30 : 0;

+ 8 - 4
im-ui/src/view/Login.vue

@@ -1,8 +1,6 @@
 <template>
 	<div class="login-view">
 		<div class="login-intro">
-			<!--<img src="@/assets/image/login.gif"/>-->
-			<div class="login-title"></div>
 			<div>
 				<h3>盒子IM 2.0版本正式发布:</h3>
 				<ul>
@@ -11,6 +9,14 @@
 					<li>页面风格升级:表情包更新、自动生成文字头像等</li>
 				</ul>
 			</div>
+			<div>
+				<h3>最近更新(2023-11-05):</h3>
+				<ul>
+					<li>聊天输入框支持粘贴截图</li>
+					<li>聊天消息支持显示已读未读状态</li>
+					<li>修改拉取离线消息机制:用户登录后,自动从服务器同步最近3个月的消息</li>
+				</ul>
+			</div>
 			<div>
 				<h3>项目依旧完全开源,可内网部署。如果项目对您有帮助,请帮忙点个star:</h3>
 			</div>
@@ -26,7 +32,6 @@
 				</a>
 
 			</div>
-
 		</div>
 		<el-form class="login-form" :model="loginForm" status-icon :rules="rules" ref="loginForm" label-width="60px"
 			@keyup.enter.native="submitForm('loginForm')">
@@ -163,7 +168,6 @@
 
 		.login-intro {
 			flex: 1;
-			height: 300px;
 			padding: 40px;
 			max-width: 600px;
 			.login-title {