kobe6258 hai 4 meses
pai
achega
c811648b94
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      middleware/auth_middleware.go

+ 4 - 3
middleware/auth_middleware.go

@@ -91,10 +91,11 @@ func encoding(data interface{}) interface{} {
 		logger.Error("json 序列化失败", err)
 		return data
 	}
-	if htConfig.NeedEncode() {
-		content = authUtils.DesBase64Encrypt(content, htConfig.GetDesCode())
-		content = []byte(`"` + string(content) + `"`)
+	if !htConfig.NeedEncode() {
+		return data
 	}
+	content = authUtils.DesBase64Encrypt(content, htConfig.GetDesCode())
+	content = []byte(`"` + string(content) + `"`)
 	return content
 }
 func AuthMiddleware() web.FilterFunc {