feat: improve frontend (#387)

* fork

* fork

* chore: update style

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
Yolo°
2023-08-12 10:49:30 +08:00
committed by GitHub
parent be780462f1
commit c58f710227
10 changed files with 98 additions and 26 deletions

View File

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