This commit is contained in:
邹宗楠
2025-06-30 10:31:57 +08:00
parent f08b6e11b3
commit e57de856e7

View File

@@ -49,7 +49,7 @@ func New(appID, serialNo, sM4Key, clientId, clientSecret, incomingToken, changeT
// AccessAPI form表单格式 // AccessAPI form表单格式
func (a *API) AccessAPI(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) { func (a *API) AccessAPI(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
if method != TokenActive { if action != TokenActive {
a.CheckToken() a.CheckToken()
} }
err = platformapi.AccessPlatformAPIWithRetry(a.client, err = platformapi.AccessPlatformAPIWithRetry(a.client,
@@ -104,7 +104,9 @@ func (a *API) AccessAPI(baseUrl, action, method string, pathParam string, bizPar
// AccessAPI2 json格式 // AccessAPI2 json格式
func (a *API) AccessAPI2(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) { func (a *API) AccessAPI2(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
a.CheckToken() if action != TokenActive {
a.CheckToken()
}
err = platformapi.AccessPlatformAPIWithRetry(a.client, err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request { func() *http.Request {
var request *http.Request var request *http.Request
@@ -159,7 +161,9 @@ func (a *API) AccessAPI2(baseUrl, action, method string, pathParam string, bizPa
// AccessAPISign 支付相关需要签名 // AccessAPISign 支付相关需要签名
func (a *API) AccessAPISign(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) { func (a *API) AccessAPISign(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
a.CheckToken() if action != TokenActive {
a.CheckToken()
}
Authorization, err := a.signParamRSA(bizParams, LaKaLaPrivateKey) Authorization, err := a.signParamRSA(bizParams, LaKaLaPrivateKey)
if err != nil { if err != nil {
return nil, err return nil, err