Sfoglia il codice sorgente

DEBUG模式要求TOKEN校验

zhou.xiaoning 4 anni fa
parent
commit
625e1b27e0
1 ha cambiato i file con 8 aggiunte e 9 eliminazioni
  1. 8 9
      token/token.go

+ 8 - 9
token/token.go

@@ -3,7 +3,6 @@ package token
 import (
 	"errors"
 	"fmt"
-	"mtp2_if/config"
 	"mtp2_if/global/e"
 	"mtp2_if/rediscli"
 	"net/http"
@@ -41,10 +40,10 @@ func CheckToken(loginid string, token string, group string) error {
 // Auth Token校验中间件
 func Auth() gin.HandlerFunc {
 	return func(c *gin.Context) {
-		if config.SerCfg.GetDebugMode() {
-			c.Next()
-			return
-		}
+		// if config.SerCfg.GetDebugMode() {
+		// 	c.Next()
+		// 	return
+		// }
 
 		var code int
 		var data interface{}
@@ -141,10 +140,10 @@ func AuthByHsby() gin.HandlerFunc {
 }
 
 func realToken(c *gin.Context) {
-	if config.SerCfg.GetDebugMode() {
-		c.Next()
-		return
-	}
+	// if config.SerCfg.GetDebugMode() {
+	// 	c.Next()
+	// 	return
+	// }
 
 	var code int
 	var data interface{}