Browse Source

test 还原

hsun 1 year ago
parent
commit
84311e6d1e
2 changed files with 10 additions and 10 deletions
  1. 5 5
      controllers/base_auth.go
  2. 5 5
      controllers/base_common.go

+ 5 - 5
controllers/base_auth.go

@@ -325,11 +325,11 @@ func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool)
 	}
 	c.logUri(content, requestBody, ip)
 	// 如果不是debug分支的话,那么需要加密返回
-	//if utils.RunMode != "debug" {
-	content = utils.DesBase64Encrypt(content, utils.DesKey)
-	// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
-	content = []byte(`"` + string(content) + `"`)
-	//}
+	if utils.RunMode != "debug" {
+		content = utils.DesBase64Encrypt(content, utils.DesKey)
+		// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
+		content = []byte(`"` + string(content) + `"`)
+	}
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}

+ 5 - 5
controllers/base_common.go

@@ -105,11 +105,11 @@ func (c *BaseCommonController) JSON(data interface{}, hasIndent bool, coding boo
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
 	c.logUri(content, requestBody, ip)
 	// 如果不是debug分支的话,那么需要加密返回
-	//if utils.RunMode != "debug" {
-	content = utils.DesBase64Encrypt(content, utils.DesKey)
-	// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
-	content = []byte(`"` + string(content) + `"`)
-	//}
+	if utils.RunMode != "debug" {
+		content = utils.DesBase64Encrypt(content, utils.DesKey)
+		// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
+		content = []byte(`"` + string(content) + `"`)
+	}
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}