This commit is contained in:
yang fan 2023-08-10 14:01:58 +00:00
parent 1aebe2bdd2
commit 985895de97

View File

@ -171,6 +171,13 @@ func UpdateToken(c *gin.Context) {
}) })
return return
} }
if len(token.Name) == 0 || len(token.Name) > 20 {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "令牌名称长度必须在1-20之间",
})
return
}
cleanToken, err := model.GetTokenByIds(token.Id, userId) cleanToken, err := model.GetTokenByIds(token.Id, userId)
if err != nil { if err != nil {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{