From 5ce5c6ce6d5f2e03cddf71766c923290260a961c Mon Sep 17 00:00:00 2001 From: xingxing Date: Thu, 25 Jan 2024 11:06:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=8F=82=E6=95=B0uid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aip/censor/ContentCensorClient.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aip/censor/ContentCensorClient.go b/aip/censor/ContentCensorClient.go index d87a2e7..086f4af 100644 --- a/aip/censor/ContentCensorClient.go +++ b/aip/censor/ContentCensorClient.go @@ -48,8 +48,9 @@ func NewCloudClient(ak string, sk string) *ContentCensorClient { return &client } -func (client *ContentCensorClient) TextCensor(text string) (result string) { +func (client *ContentCensorClient) TextCensor(text string, uid string) (result string) { data := make(map[string]string) + data["userId"] = uid data["text"] = text return baseClient.PostUrlForm(__textCensorUserDefinedUrl, data, &client.auth) } From 95ab13f2c11615399e072d4e8692b7e187b8404e Mon Sep 17 00:00:00 2001 From: xingxing Date: Thu, 25 Jan 2024 11:41:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baseClient/BaseClient.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/baseClient/BaseClient.go b/baseClient/BaseClient.go index 0755a84..d4e2fcb 100644 --- a/baseClient/BaseClient.go +++ b/baseClient/BaseClient.go @@ -60,7 +60,7 @@ func (auth *Auth) InitCloudAuth(ak string, sk string) { auth.ak = ak auth.sk = sk auth.client = http.Client{ - Timeout: time.Second * 20, + Timeout: time.Second * 20, } auth.isCloudUser = true } @@ -122,7 +122,6 @@ func (auth *Auth) setHeader(req *http.Request) { canonicalURI = "/" } canonicalURI = url.QueryEscape(canonicalURI) - canonicalURI = strings.ReplaceAll(canonicalURI, "%2F", "/") canonicalQueryString := req.URL.RawQuery if canonicalQueryString != "" { queryArray := strings.Split(canonicalQueryString, "&")