chore: update token related logic

This commit is contained in:
JustSong
2022-11-11 20:02:28 +08:00
parent e1d09aa58f
commit d42b4511cf
6 changed files with 71 additions and 55 deletions

View File

@@ -16,7 +16,7 @@ func authHelper(c *gin.Context, minRole int) {
if username == nil {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "无权进行此操作,未登录或 token 无效",
"message": "无权进行此操作,用户未登录",
})
c.Abort()
return
@@ -32,7 +32,7 @@ func authHelper(c *gin.Context, minRole int) {
if role.(int) < minRole {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "无权进行此操作,未登录或 token 无效,或没有权限",
"message": "无权进行此操作,用户未登录或没有权限",
})
c.Abort()
return