Browse Source

fix:测试环境不加密

Roc 3 years ago
parent
commit
f5d028f4da
1 changed files with 8 additions and 2 deletions
  1. 8 2
      controller/response/base.go

+ 8 - 2
controller/response/base.go

@@ -24,8 +24,14 @@ type ResultData struct {
 func result(code int, resultData ResultData, c *gin.Context) {
 	jsonByte, _ := json.Marshal(resultData)
 	global.LOG.Debug("resultData:", string(jsonByte))
-	responseResult := utils.DesBase64Encrypt(jsonByte)
-	c.JSON(code, responseResult)
+
+	//测试环境,数据不进行加密
+	if global.CONFIG.Serve.RunMode == "debug" {
+		c.JSON(code, resultData)
+	} else {
+		responseResult := utils.DesBase64Encrypt(jsonByte)
+		c.JSON(code, responseResult)
+	}
 	c.Abort()
 }