Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add添加审核参数uid #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aip/censor/ContentCensorClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions baseClient/BaseClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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, "&")
Expand Down