超级token

This commit is contained in:
junleea 2025-03-05 19:40:55 +08:00
parent a6954f8f9e
commit 0ebc447c32
1 changed files with 9 additions and 9 deletions

18
main.go
View File

@ -137,15 +137,15 @@ 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 == "" {
// 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")
}