mirror of
https://github.com/songquanpeng/message-pusher.git
synced 2025-10-16 21:10:56 +08:00
fix: only return necessary information to frontend
This commit is contained in:
@@ -74,12 +74,17 @@ func setupLogin(user *model.User, c *gin.Context) {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user.Password = ""
|
cleanUser := model.User{
|
||||||
user.Token = ""
|
Id: user.Id,
|
||||||
|
Username: user.Username,
|
||||||
|
DisplayName: user.DisplayName,
|
||||||
|
Role: user.Role,
|
||||||
|
Status: user.Status,
|
||||||
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"message": "",
|
"message": "",
|
||||||
"success": true,
|
"success": true,
|
||||||
"data": user,
|
"data": cleanUser,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user