From df7d4d5b94e64d254a00be31797c0aca3d67f19a Mon Sep 17 00:00:00 2001 From: RockYang Date: Fri, 7 Apr 2023 19:26:24 +0800 Subject: [PATCH] the new skin is ready --- server/chat_handler.go | 12 +-- web/src/components/plus/ChatPrompt.vue | 10 +- web/src/components/plus/ChatReply.vue | 91 +++++++++--------- web/src/main.js | 8 +- web/src/views/ChatPlus.vue | 122 ++++++++++++++----------- 5 files changed, 134 insertions(+), 109 deletions(-) diff --git a/server/chat_handler.go b/server/chat_handler.go index 1aca89f..4754755 100644 --- a/server/chat_handler.go +++ b/server/chat_handler.go @@ -57,13 +57,13 @@ func (s *Server) ChatHandle(c *gin.Context) { } logger.Info("Receive a message: ", string(message)) - replyMessage(client, "当前 TOKEN 无效,请使用合法的 TOKEN 登录!", false) - replyMessage(client, "![](images/wx.png)", true) + //replyMessage(client, "当前 TOKEN 无效,请使用合法的 TOKEN 登录!", false) + //replyMessage(client, "![](images/wx.png)", true) // TODO: 当前只保持当前会话的上下文,部保存用户的所有的聊天历史记录,后期要考虑保存所有的历史记录 - //err = s.sendMessage(session, chatRole, string(message), client, false) - //if err != nil { - // logger.Error(err) - //} + err = s.sendMessage(session, chatRole, string(message), client, false) + if err != nil { + logger.Error(err) + } } }() } diff --git a/web/src/components/plus/ChatPrompt.vue b/web/src/components/plus/ChatPrompt.vue index 33c70e7..e615bb0 100644 --- a/web/src/components/plus/ChatPrompt.vue +++ b/web/src/components/plus/ChatPrompt.vue @@ -32,7 +32,7 @@ export default defineComponent({ }) -