前台fix,回调
This commit is contained in:
parent
2f88c1be58
commit
6a977db12e
app
|
@ -110,15 +110,19 @@ func (o *OrderNotify) sendNotify(body *OrderNotifySendContent) {
|
|||
if err != nil || string(resByte) != "success" {
|
||||
o.Code = errorcode.NotifySendFail
|
||||
callbackStatus = common.STATUS_DISABLED
|
||||
response = "url=" + o.app.NotifyUrl + "|error=" + err.Error()
|
||||
if err != nil {
|
||||
response = " | url=" + o.app.NotifyUrl + " | error=" + err.Error()
|
||||
} else {
|
||||
response = " | url=" + o.app.NotifyUrl
|
||||
}
|
||||
}
|
||||
response = string(resByte) + response
|
||||
response = "response=" + string(resByte) + response
|
||||
// 记录回调日志
|
||||
go func(orderId int64, status int, request, response string) {
|
||||
repo := data.NewOrderCallbackLogRepo(ordercallbacklogmodel.GetInstance().GetDb())
|
||||
log := ordercallbacklogmodel.OrderCallbackLog{
|
||||
OrderId: orderId,
|
||||
MerchantRequest: string(bodyByte),
|
||||
MerchantRequest: request,
|
||||
Status: status,
|
||||
MerchantResponse: response,
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ func FastHttpPost(url string, header map[string]string, body []byte, timeout int
|
|||
resp := fasthttp.AcquireResponse()
|
||||
defer fasthttp.ReleaseResponse(resp) // 用完需要释放资源
|
||||
var err error
|
||||
if timeout > 0 {
|
||||
if timeout <= 0 {
|
||||
if err = fasthttp.Do(req, resp); err != nil {
|
||||
utils.Log(nil, "http请求失败", err, url)
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue