This commit is contained in:
yedf2 2021-08-10 17:15:05 +08:00
parent 2cb1045317
commit f9f5f501cc

View File

@ -170,7 +170,7 @@ func (t *TransGlobal) getURLResult(url string, branchID, branchType string, bran
BranchID: branchID, BranchID: branchID,
BranchType: branchType, BranchType: branchType,
}, },
BusiData: []byte(branchData), BusiData: branchData,
}, &emptypb.Empty{}) }, &emptypb.Empty{})
if err == nil { if err == nil {
return "SUCCESS" return "SUCCESS"
@ -180,7 +180,7 @@ func (t *TransGlobal) getURLResult(url string, branchID, branchType string, bran
return err.Error() return err.Error()
} }
dtmcli.PanicIf(!strings.HasPrefix(url, "http"), fmt.Errorf("bad url for http: %s", url)) dtmcli.PanicIf(!strings.HasPrefix(url, "http"), fmt.Errorf("bad url for http: %s", url))
resp, err := dtmcli.RestyClient.R().SetBody(branchData). resp, err := dtmcli.RestyClient.R().SetBody(string(branchData)).
SetQueryParams(dtmcli.MS{ SetQueryParams(dtmcli.MS{
"gid": t.Gid, "gid": t.Gid,
"trans_type": t.TransType, "trans_type": t.TransType,
@ -188,7 +188,7 @@ func (t *TransGlobal) getURLResult(url string, branchID, branchType string, bran
"branch_type": branchType, "branch_type": branchType,
}). }).
SetHeader("Content-type", "application/json"). SetHeader("Content-type", "application/json").
Post(url) Execute(dtmcli.If(branchData == nil, "GET", "POST").(string), url)
e2p(err) e2p(err)
return resp.String() return resp.String()
} }