|
@@ -235,7 +235,17 @@ func (c *BaseAuthController) ServeJSON(encoding ...bool) {
|
|
|
go cache.RecordNewLogs(c.SysUser.AdminId, requestBody, string(body), c.SysUser.RealName, c.Ctx.Input.IP(), c.Ctx.Input.URI())
|
|
|
}
|
|
|
}
|
|
|
- c.JSON(c.Data["json"], hasIndent, hasEncoding)
|
|
|
+
|
|
|
+ // 数据加密
|
|
|
+ var result interface{}
|
|
|
+ result = c.Data["json"]
|
|
|
+ if utils.RunMode != "debug" {
|
|
|
+ jsonByte, _ := json.Marshal(c.Data["json"])
|
|
|
+ encryptResult := utils.DesBase64Encrypt(jsonByte)
|
|
|
+ result = string(encryptResult)
|
|
|
+ }
|
|
|
+
|
|
|
+ c.JSON(result, hasIndent, hasEncoding)
|
|
|
}
|
|
|
|
|
|
func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool) error {
|