소스 검색

生产加密

kobe6258 4 달 전
부모
커밋
c811648b94
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  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 {