Commit 3eb357a1 by JustSong

fix: fix token name too long

parent 8c3eb090
...@@ -109,7 +109,7 @@ func AddToken(c *gin.Context) { ...@@ -109,7 +109,7 @@ func AddToken(c *gin.Context) {
}) })
return return
} }
if len(token.Name) == 0 || len(token.Name) > 30 { if len(token.Name) > 30 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "令牌名称过长", "message": "令牌名称过长",
...@@ -171,7 +171,7 @@ func UpdateToken(c *gin.Context) { ...@@ -171,7 +171,7 @@ func UpdateToken(c *gin.Context) {
}) })
return return
} }
if len(token.Name) == 0 || len(token.Name) > 30 { if len(token.Name) > 30 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "令牌名称过长", "message": "令牌名称过长",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment