From 1ef8c26b929e1159acc9fb7dd0bbc05bb00d0dae Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Fri, 11 Oct 2024 23:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dh5=E9=94=AE=E7=9B=98=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netty/processor/LoginProcessor.java | 2 +- im-uniapp/main.js | 5 +++- im-uniapp/package.json | 3 ++- im-uniapp/pages/chat/chat-box.vue | 25 +++++++++++++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java b/im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java index c3ef039..c0258d3 100644 --- a/im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java +++ b/im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java @@ -34,7 +34,7 @@ public class LoginProcessor extends AbstractMessageProcessor { private String accessTokenSecret; @Override - public synchronized void process(ChannelHandlerContext ctx, IMLoginInfo loginInfo) { + public void process(ChannelHandlerContext ctx, IMLoginInfo loginInfo) { if (!JwtUtil.checkSign(loginInfo.getAccessToken(), accessTokenSecret)) { ctx.channel().close(); log.warn("用户token校验不通过,强制下线,token:{}", loginInfo.getAccessToken()); diff --git a/im-uniapp/main.js b/im-uniapp/main.js index 7e5c597..c4f6317 100644 --- a/im-uniapp/main.js +++ b/im-uniapp/main.js @@ -13,7 +13,10 @@ import useFriendStore from '@/store/friendStore.js' import useGroupStore from '@/store/groupStore.js' import useConfigStore from '@/store/configStore.js' import useUserStore from '@/store/userStore.js' - + +//import VConsole from 'vconsole' +//new VConsole(); + // #ifdef H5 import * as recorder from './common/recorder-h5'; // #endif diff --git a/im-uniapp/package.json b/im-uniapp/package.json index 4b762f2..f4368f4 100644 --- a/im-uniapp/package.json +++ b/im-uniapp/package.json @@ -5,6 +5,7 @@ }, "dependencies": { "js-audio-recorder": "^1.0.7", - "pinyin-pro": "^3.23.1" + "pinyin-pro": "^3.23.1", + "vconsole": "^3.15.1" } } diff --git a/im-uniapp/pages/chat/chat-box.vue b/im-uniapp/pages/chat/chat-box.vue index ad34162..5c9f53e 100644 --- a/im-uniapp/pages/chat/chat-box.vue +++ b/im-uniapp/pages/chat/chat-box.vue @@ -45,7 +45,7 @@ @touchend.prevent="sendTextMessage()" size="mini">发送 - + { + let keyboardHeight = initHeight - window.innerHeight; + if (keyboardHeight > 0) { + this.keyboardHeight = this.rpxTopx(keyboardHeight); + this.showKeyBoard = true; + this.switchChatTabBox('none', false) + this.scrollToBottom(); + } else { + this.showKeyBoard = false; + } + }); + }, generateId() { // 生成临时id return String(new Date().getTime()) + String(Math.floor(Math.random() * 1000)); @@ -721,6 +738,10 @@ } }, onLoad(options) { + // #ifdef H5 + this.isH5 = true; + this.listenKeyBoardForH5(); + // #endif // 聊天数据 this.chat = this.chatStore.chats[options.chatIdx]; // 初始状态只显示20条消息