diff --git a/business/partner/delivery/sfps/waybill.go b/business/partner/delivery/sfps/waybill.go index 9e3c3ed7b..7aa6731a8 100644 --- a/business/partner/delivery/sfps/waybill.go +++ b/business/partner/delivery/sfps/waybill.go @@ -1,6 +1,7 @@ package sfps import ( + "bufio" "encoding/json" "errors" "fmt" @@ -474,12 +475,16 @@ func pushCallbackToGy(urlIndex string, msg interface{}) { param = changeToRaw(urlIndex, msg) globals.SugarLogger.Debugf("sfsfsf pushCallbackToGy param=%s", utils.Format4Output(param, false)) - b, _ := json.Marshal(param) + b, err := json.Marshal(param) + + if err != nil { + globals.SugarLogger.Debugf("pushCallbackToGy marshal err=%v", err) + } switch urlIndex { case sfps2.UrlIndexRiderException: - request, err = http.NewRequest(http.MethodPost, "http://callback-jxgy.jxc4.com/SFPS/SfAbnormal", strings.NewReader(string(b))) + request, err = http.NewRequest(http.MethodPost, "http://callback-jxgy.jxc4.com/SFPS/SfAbnormal", bufio.NewReader(strings.NewReader(string(b)))) default: - request, err = http.NewRequest(http.MethodPost, "http://callback-jxgy.jxc4.com/SFPS/SfOrder", strings.NewReader(string(b))) + request, err = http.NewRequest(http.MethodPost, "http://callback-jxgy.jxc4.com/SFPS/SfOrder", bufio.NewReader(strings.NewReader(string(b)))) } globals.SugarLogger.Debugf("pushCallbackToGy request=%s,err=%v", utils.Format4Output(request, false), err) if err != nil {