From 02a9c422fe57e558ee29051e35682be3dc07558c Mon Sep 17 00:00:00 2001 From: RockYang Date: Thu, 29 Feb 2024 15:41:45 +0800 Subject: [PATCH] fix: fixed bug image preview im mobile chat session page --- api/handler/chatimpl/chat_handler.go | 1 + api/main.go | 3 --- web/src/components/mobile/ChatReply.vue | 2 +- web/src/views/mobile/ChatSession.vue | 14 +++++++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/api/handler/chatimpl/chat_handler.go b/api/handler/chatimpl/chat_handler.go index 90effac7..58fcaa43 100644 --- a/api/handler/chatimpl/chat_handler.go +++ b/api/handler/chatimpl/chat_handler.go @@ -131,6 +131,7 @@ func (h *ChatHandler) ChatHandle(c *gin.Context) { c.Abort() return } + h.Init() // 保存会话连接 h.App.ChatClients.Put(sessionId, client) diff --git a/api/main.go b/api/main.go index cd1e9bda..e1a45534 100644 --- a/api/main.go +++ b/api/main.go @@ -393,9 +393,6 @@ func main() { log.Fatal(err) } }), - fx.Invoke(func(h *chatimpl.ChatHandler) { - h.Init() - }), // 注册生命周期回调函数 fx.Invoke(func(lifecycle fx.Lifecycle, lc *AppLifecycle) { lifecycle.Append(fx.Hook{ diff --git a/web/src/components/mobile/ChatReply.vue b/web/src/components/mobile/ChatReply.vue index 2c46e47e..90e0541a 100644 --- a/web/src/components/mobile/ChatReply.vue +++ b/web/src/components/mobile/ChatReply.vue @@ -15,7 +15,7 @@