fix: limit the shown text's length (close #80)

This commit is contained in:
JustSong
2023-05-16 21:33:59 +08:00
parent 519cb030f7
commit e8da98139f
3 changed files with 30 additions and 8 deletions

View File

@@ -467,6 +467,13 @@ func CreateUser(c *gin.Context) {
})
return
}
if err := common.Validate.Struct(&user); err != nil {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "输入不合法 " + err.Error(),
})
return
}
if user.DisplayName == "" {
user.DisplayName = user.Username
}