feat: chat list page for mobile is ready

This commit is contained in:
RockYang
2023-06-25 06:53:22 +08:00
parent 3c8b5cb313
commit 2cadd6af44
6 changed files with 153 additions and 26 deletions

View File

@@ -218,10 +218,9 @@ func (h *UserHandler) Logout(c *gin.Context) {
// Session 获取/验证会话
func (h *UserHandler) Session(c *gin.Context) {
sessionId := c.GetHeader(types.SessionName)
session := h.App.ChatSession.Get(sessionId)
if session.ClientIP == c.ClientIP() {
resp.SUCCESS(c, session)
user, err := utils.GetLoginUser(c, h.db)
if err == nil {
resp.SUCCESS(c, user)
} else {
resp.NotAuth(c)
}