Bladeren bron

fix: 会话中emo表情阻断时间的bug

xsx 1 jaar geleden
bovenliggende
commit
3fcda25588

+ 1 - 1
im-server/src/main/java/com/bx/imserver/netty/ws/WebSocketServer.java

@@ -61,7 +61,7 @@ public class WebSocketServer implements IMServer {
                     protected void initChannel(Channel ch) {
                         // 获取职责链
                         ChannelPipeline pipeline = ch.pipeline();
-                        pipeline.addLast(new IdleStateHandler(120, 0, 0, TimeUnit.SECONDS));
+                        pipeline.addLast(new IdleStateHandler(60, 0, 0, TimeUnit.SECONDS));
                         pipeline.addLast("http-codec", new HttpServerCodec());
                         pipeline.addLast("aggregator", new HttpObjectAggregator(65535));
                         pipeline.addLast("http-chunked", new ChunkedWriteHandler());

+ 11 - 3
im-uniapp/components/chat-item/chat-item.vue

@@ -1,5 +1,7 @@
 <template>
-	<view class="chat-item" :class="active?'active':''" @click="showChatBox()">
+	<view class="chat-item" :class="active?'active':''" >
+		<!--rich-text中的表情包会屏蔽事件,所以这里用一个遮罩层捕获点击事件 -->
+		<view class="mask" @tap="showChatBox()"></view>
 		<view class="left">
 			<head-image :url="chat.headImage" :name="chat.showName" :size="90"></head-image>
 			<view v-if="chat.unreadCount>0" class="unread-text">{{chat.unreadCount}}</view>
@@ -12,7 +14,7 @@
 			<view class="chat-content">
 				<view class="chat-at-text">{{atText}}</view>
 				<view class="chat-send-name" v-show="chat.sendNickName">{{chat.sendNickName+':&nbsp;'}}</view>
-				<rich-text class="chat-content-text" :nodes="$emo.transform(chat.lastContent)"></rich-text>
+				<rich-text class="chat-content-text"  :nodes="$emo.transform(chat.lastContent)"></rich-text>
 			</view>
 		</view>
 	</view>
@@ -75,7 +77,13 @@
 		&.active {
 			background-color: #eeeeee;
 		}
-
+		
+		
+		.mask {
+			position: absolute;
+			width: 100%;
+			height: 100%;
+		}
 		.left {
 			position: relative;
 			display: flex;