提交 ef6265c0 authored 作者: 张立波's avatar 张立波

云众

上级 5fae905c
......@@ -13,6 +13,7 @@ import (
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/grand"
"net/url"
"sort"
"time"
)
......@@ -98,15 +99,22 @@ func get(ctx context.Context, method string, params g.Map, xToken ...interface{}
if err != nil {
return
}
postValues := url.Values{}
for k, v := range params {
postValues.Add(k, gconv.String(v))
}
URL, _ := url.Parse(Url + method)
URL.RawQuery = postValues.Encode()
urlPath := URL.String()
Request.SetHeader("App-Sign", AppSign)
resp, err := Request.
Timeout(time.Second*5).
Get(Url+method, params)
//resp.RawDump()
Timeout(time.Second * 5).
Get(urlPath)
resp.RawDump()
defer func() {
_ = resp.Close()
paramStr := gjson.New(params).MustToJsonString()
ctx = context.WithValue(ctx, "Method", "POST")
ctx = context.WithValue(ctx, "Method", "GET")
ctx = context.WithValue(ctx, "URI", method)
if err != nil {
g.Log().Ctx(ctx).Cat(pkgName).Cat("error").Infof("参数【%v】错误【%v】响应时间【%v ms】", paramStr, err.Error(), gtime.TimestampMilli()-Start)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论