feat: vue-mobile => 完成会话聊天页面功能,增加主题切换功能

This commit is contained in:
RockYang
2023-06-26 16:39:00 +08:00
parent b9e9eae93f
commit 6a733de556
11 changed files with 417 additions and 258 deletions

View File

@@ -52,9 +52,19 @@ func (h *ChatHandler) ChatHandle(c *gin.Context) {
session := h.App.ChatSession.Get(sessionId)
if session.SessionId == "" {
logger.Info("用户未登录")
c.Abort()
return
user, err := utils.GetLoginUser(c, h.db)
if err != nil {
logger.Info("用户未登录")
c.Abort()
return
}
session = types.ChatSession{
SessionId: sessionId,
ClientIP: c.ClientIP(),
Username: user.Username,
UserId: user.Id,
}
h.App.ChatSession.Put(sessionId, session)
}
// use old chat data override the chat model and role ID