From 2a527ee4360113c6fa1fbf204d4ca83fc5665c3e Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 12 Aug 2023 16:58:29 +0800 Subject: [PATCH] fix: fix token name too long --- controller/token.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/token.go b/controller/token.go index b05d820a..8642122c 100644 --- a/controller/token.go +++ b/controller/token.go @@ -109,7 +109,7 @@ func AddToken(c *gin.Context) { }) return } - if len(token.Name) == 0 || len(token.Name) > 30 { + if len(token.Name) > 30 { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "令牌名称过长", @@ -171,7 +171,7 @@ func UpdateToken(c *gin.Context) { }) return } - if len(token.Name) == 0 || len(token.Name) > 30 { + if len(token.Name) > 30 { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "令牌名称过长",