- weimob order and callback

This commit is contained in:
gazebo
2019-01-19 11:03:00 +08:00
parent 2c49d9f1c8
commit 6aeb39d53b
7 changed files with 217 additions and 17 deletions

View File

@@ -105,7 +105,7 @@ func (a *API) MustGetToken() *TokenInfo {
return token
}
func (a *API) AccessAPI(apiStr string, apiParams map[string]interface{}) (retVal map[string]interface{}, err error) {
func (a *API) AccessAPI(apiStr string, apiParams map[string]interface{}) (retVal interface{}, err error) {
err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request {
var request *http.Request
@@ -171,7 +171,7 @@ func (a *API) AccessAPI(apiStr string, apiParams map[string]interface{}) (retVal
errMsg = errMap["errmsg"].(string)
}
if code == ResponseCodeSuccess {
retVal = jsonResult1["data"].(map[string]interface{})
retVal = jsonResult1["data"]
return platformapi.ErrLevelSuccess, nil
}
}
@@ -203,7 +203,7 @@ func (a *API) RefreshTokenByCode(code, redirectURL string) (retVal *TokenInfo, e
"redirect_uri": redirectURL,
})
if err == nil {
retVal = map2TokenInfo(result)
retVal = map2TokenInfo(result.(map[string]interface{}))
a.SetToken(retVal)
return retVal, nil
}
@@ -218,7 +218,7 @@ func (a *API) RefreshTokenByRefreshToken() (retVal *TokenInfo, err error) {
"refresh_token": curToken.RefreshToken,
})
if err == nil {
retVal = map2TokenInfo(result)
retVal = map2TokenInfo(result.(map[string]interface{}))
a.SetToken(retVal)
return retVal, nil