diff --git a/controllers/api_controller.go b/controllers/api_controller.go index 9b848be38..0179423ee 100644 --- a/controllers/api_controller.go +++ b/controllers/api_controller.go @@ -1,6 +1,7 @@ package controllers import ( + "bytes" "crypto/md5" "encoding/json" "fmt" @@ -374,8 +375,11 @@ func (c *ApiController) GetPrintMsg(dataMap map[string]interface{}) (data, errCo } else if printMsg == nil { return "", model.ErrCodeGeneralFailed, fmt.Errorf("未查询到该消息! msg_id: %v", msgID) } else { - if byteData, err := json.Marshal(printMsg); err == nil { - data = string(byteData) + bf := bytes.NewBuffer([]byte{}) + jsonEncoder := json.NewEncoder(bf) + jsonEncoder.SetEscapeHTML(false) + if err2 := jsonEncoder.Encode(printMsg); err2 == nil { + data = bf.String() } else { return "", model.ErrCodeGeneralFailed, err }