From 7ae6e6315d772d0759b452133ae42f83d3fa9665 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Mon, 22 Jul 2024 00:36:14 +0800 Subject: [PATCH] =?UTF-8?q?uniapp=20=E7=95=8C=E9=9D=A2=E7=BE=8E=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bx/imcommon/mq/RedisMQPullTask.java | 7 +- im-ui/src/components/friend/FriendItem.vue | 3 +- im-uniapp/App.vue | 3 +- im-uniapp/components/chat-item/chat-item.vue | 3 +- .../components/head-image/head-image.vue | 12 +- im-uniapp/main.js | 2 + im-uniapp/package.json | 3 +- im-uniapp/pages.json | 12 +- im-uniapp/pages/chat/chat-box.vue | 44 +++---- im-uniapp/pages/friend/friend-add.vue | 2 +- im-uniapp/pages/friend/friend-search.vue | 2 +- im-uniapp/pages/friend/friend.vue | 117 +++++++++++++----- im-uniapp/pages/group/group.vue | 10 +- im-uniapp/store/friendStore.js | 23 +++- im-uniapp/uni.scss | 20 +-- 15 files changed, 170 insertions(+), 93 deletions(-) diff --git a/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java b/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java index cf5bf99..45b73b7 100644 --- a/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java +++ b/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java @@ -42,7 +42,7 @@ public class RedisMQPullTask implements CommandLineRunner { consumers.forEach((consumer -> { // 注解参数 RedisMQListener annotation = consumer.getClass().getAnnotation(RedisMQListener.class); - String key = consumer.generateKey(); + String queue = annotation.queue(); int batchSize = annotation.batchSize(); int period = annotation.period(); // 获取泛型类型 @@ -54,6 +54,7 @@ public class RedisMQPullTask implements CommandLineRunner { List datas = new LinkedList<>(); try { if(consumer.isReady()){ + String key = consumer.generateKey(); // 拉取一个批次的数据 List objects = pullBatch(key, batchSize); for (Object obj : objects) { @@ -69,7 +70,7 @@ public class RedisMQPullTask implements CommandLineRunner { } } } catch (Exception e) { - log.error("数据消费异常,队列:{}", key, e); + log.error("数据消费异常,队列:{}", queue, e); } // 继续消费数据 if (!EXECUTOR_SERVICE.isShutdown()) { @@ -90,7 +91,7 @@ public class RedisMQPullTask implements CommandLineRunner { List objects = new LinkedList<>(); if (redisMQTemplate.isSupportBatchPull()) { // 版本大于6.2,支持批量拉取 - objects = redisMQTemplate.opsForList().leftPop(key, 100); + objects = redisMQTemplate.opsForList().leftPop(key, batchSize); } else { // 版本小于6.2,只能逐条拉取 Object obj = redisMQTemplate.opsForList().leftPop(key); diff --git a/im-ui/src/components/friend/FriendItem.vue b/im-ui/src/components/friend/FriendItem.vue index 1e86fe0..5be5222 100644 --- a/im-ui/src/components/friend/FriendItem.vue +++ b/im-ui/src/components/friend/FriendItem.vue @@ -59,7 +59,7 @@ }, onSelectMenu(item) { this.$emit(item.key.toLowerCase(), this.msgInfo); - } + } }, computed:{ friend(){ @@ -78,6 +78,7 @@ default: true } } + } diff --git a/im-uniapp/App.vue b/im-uniapp/App.vue index 432ec85..2891dfd 100644 --- a/im-uniapp/App.vue +++ b/im-uniapp/App.vue @@ -351,8 +351,9 @@