- fk
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -92,7 +91,8 @@ func (a *API) RetrieveToken() (token string, err error) {
|
|||||||
func (a *API) signParams(timestamp int64) string {
|
func (a *API) signParams(timestamp int64) string {
|
||||||
mac := hmac.New(sha256.New, []byte(a.GetSecret()))
|
mac := hmac.New(sha256.New, []byte(a.GetSecret()))
|
||||||
mac.Write([]byte(utils.Int64ToStr(timestamp)))
|
mac.Write([]byte(utils.Int64ToStr(timestamp)))
|
||||||
return url.QueryEscape(base64.StdEncoding.EncodeToString(mac.Sum(nil)))
|
// return url.QueryEscape(base64.StdEncoding.EncodeToString(mac.Sum(nil)))
|
||||||
|
return base64.StdEncoding.EncodeToString(mac.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) AccessAPI(action string, params map[string]interface{}, bodyMap map[string]interface{}) (retVal map[string]interface{}, err error) {
|
func (a *API) AccessAPI(action string, params map[string]interface{}, bodyMap map[string]interface{}) (retVal map[string]interface{}, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user