Fu Diwei 2024-11-05 18:09:06 +08:00
parent 718cfccbea
commit 8549a17675
1 changed files with 2 additions and 1 deletions

View File

@ -153,7 +153,8 @@ func (c *Client) sendReq(method string, path string, data map[string]interface{}
mime = "application/x-www-form-urlencoded"
}
signStr := path + "\n" + body
path = strings.TrimPrefix(path, "/")
signStr := "/" + path + "\n" + body
hmacObj := hmac.New(sha1.New, []byte(c.secretKey))
hmacObj.Write([]byte(signStr))
sign := hex.EncodeToString(hmacObj.Sum(nil))