瀏覽代碼

fix:测试环境不加密

Roc 3 年之前
父節點
當前提交
f5d028f4da
共有 1 個文件被更改,包括 8 次插入2 次删除
  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()
 }