diff --git a/const.go b/const.go index cee4871..a64cf13 100644 --- a/const.go +++ b/const.go @@ -14,7 +14,7 @@ const ( // SDK 相关信息 const ( - Version = "1.0.12" // SDK 版本 + Version = "1.0.13" // SDK 版本 UserAgentFormat = "WechatPay-Go/%s (%s) GO/%s" // UserAgent中的信息 ) diff --git a/request.go b/request.go index 9b69851..f2b8047 100644 --- a/request.go +++ b/request.go @@ -28,6 +28,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte // 设置参数 client.SetParams(params) + // 设置用户代理 + client.SetUserAgent(gorequest.GetRandomUserAgentSystem()) + // 设置头部 client.SetHeader("Authorization", authorization) client.SetHeader("Accept", "application/json")