From 2042c11b4043f25d3c1535fdf5354e47d4ca71c9 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Wed, 5 Mar 2025 19:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 2dc7e18..b99820f 100644 --- a/main.go +++ b/main.go @@ -137,20 +137,17 @@ func JWTAuthMiddleware() gin.HandlerFunc { //查看token是否在超级token中 if worker.IsContainSet("super_permission_tokens", tokenString) { sId := c.Request.Header.Get("super_id") - //if sId == "" { - // c.AbortWithStatus(200) - // c.JSON(200, gin.H{ - // "message": "NOT_LOGIN", - // "error": "super_id is empty", - // "code": proto.TokenIsNull, - // }) - // return - //} if sId == "" { sId = c.Query("super_id") } if sId == "" { - sId = "1" + c.AbortWithStatus(200) + c.JSON(200, gin.H{ + "message": "NOT_LOGIN", + "error": "super_id is empty", + "code": proto.TokenIsNull, + }) + return } log.Printf("req super_id:%s", sId) id, _ := strconv.Atoi(sId)