mirror of
https://github.com/songquanpeng/message-pusher.git
synced 2025-10-16 04:50:42 +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
|
||||
}
|
||||
user.Password = ""
|
||||
user.Token = ""
|
||||
cleanUser := model.User{
|
||||
Id: user.Id,
|
||||
Username: user.Username,
|
||||
DisplayName: user.DisplayName,
|
||||
Role: user.Role,
|
||||
Status: user.Status,
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"message": "",
|
||||
"success": true,
|
||||
"data": user,
|
||||
"data": cleanUser,
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user