From 1677bbbee3f933ec40122adc43383da1b6738e5e Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Thu, 15 Jul 2021 09:36:02 +0800 Subject: [PATCH] aa --- controllers/api_controller.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/controllers/api_controller.go b/controllers/api_controller.go index 420165e3b..a5d68dbef 100644 --- a/controllers/api_controller.go +++ b/controllers/api_controller.go @@ -1,7 +1,9 @@ package controllers import ( + "bytes" "crypto/md5" + "encoding/json" "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxstore/cms" @@ -373,12 +375,12 @@ func (c *ApiController) GetPrintMsg(dataMap map[string]interface{}) (printMsg *c } else if printMsg == nil { return printMsg, model.ErrCodeGeneralFailed, fmt.Errorf("未查询到该消息! msg_id: %v", msgID) } else { - //bf := bytes.NewBuffer([]byte{}) - //jsonEncoder := json.NewEncoder(bf) - //jsonEncoder.SetEscapeHTML(false) - //if err2 := jsonEncoder.Encode(printMsg); err2 == nil { - // data = strings.Replace(bf.String(), "\n", "", strings.LastIndex(bf.String(), "\n")) - //} else { + bf := bytes.NewBuffer([]byte{}) + jsonEncoder := json.NewEncoder(bf) + jsonEncoder.SetEscapeHTML(false) + if err2 := jsonEncoder.Encode(printMsg.Content); err2 == nil { + printMsg.Content = strings.Replace(bf.String(), "\n", "", strings.LastIndex(bf.String(), "\n")) + } return printMsg, model.ErrCodeGeneralFailed, err } return printMsg, errCode, err