Browse Source

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

master
xsx 2 years ago
parent
commit
3fcda25588
  1. 2
      im-server/src/main/java/com/bx/imserver/netty/ws/WebSocketServer.java
  2. 14
      im-uniapp/components/chat-item/chat-item.vue

2
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) { protected void initChannel(Channel ch) {
// 获取职责链 // 获取职责链
ChannelPipeline pipeline = ch.pipeline(); 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("http-codec", new HttpServerCodec());
pipeline.addLast("aggregator", new HttpObjectAggregator(65535)); pipeline.addLast("aggregator", new HttpObjectAggregator(65535));
pipeline.addLast("http-chunked", new ChunkedWriteHandler()); pipeline.addLast("http-chunked", new ChunkedWriteHandler());

14
im-uniapp/components/chat-item/chat-item.vue

@ -1,5 +1,7 @@
<template> <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"> <view class="left">
<head-image :url="chat.headImage" :name="chat.showName" :size="90"></head-image> <head-image :url="chat.headImage" :name="chat.showName" :size="90"></head-image>
<view v-if="chat.unreadCount>0" class="unread-text">{{chat.unreadCount}}</view> <view v-if="chat.unreadCount>0" class="unread-text">{{chat.unreadCount}}</view>
@ -12,7 +14,7 @@
<view class="chat-content"> <view class="chat-content">
<view class="chat-at-text">{{atText}}</view> <view class="chat-at-text">{{atText}}</view>
<view class="chat-send-name" v-show="chat.sendNickName">{{chat.sendNickName+':&nbsp;'}}</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> </view>
</view> </view>
@ -75,7 +77,13 @@
&.active { &.active {
background-color: #eeeeee; background-color: #eeeeee;
} }
.mask {
position: absolute;
width: 100%;
height: 100%;
}
.left { .left {
position: relative; position: relative;
display: flex; display: flex;

Loading…
Cancel
Save