From ab0ff7b9347c339ed5c6aa4ce73d61b7cb7c3a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Mon, 5 Sep 2022 09:21:00 +0800 Subject: [PATCH] - add request UserAgent --- const.go | 2 +- request.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/const.go b/const.go index 82eb7db..955cc4b 100644 --- a/const.go +++ b/const.go @@ -3,5 +3,5 @@ package wechatopen const ( apiUrl = "https://api.weixin.qq.com" logTable = "wechatopen" - Version = "1.0.29" + Version = "1.0.30" ) diff --git a/request.go b/request.go index fcdf9bc..b44c772 100644 --- a/request.go +++ b/request.go @@ -19,6 +19,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte // 设置格式 client.SetContentTypeJson() + // 设置用户代理 + client.SetUserAgent(gorequest.GetRandomUserAgentSystem()) + // 设置参数 client.SetParams(params)