This commit is contained in:
苏尹岚
2021-02-04 17:02:38 +08:00
parent 48f4a7179c
commit d3861a357b
3 changed files with 44 additions and 4 deletions

View File

@@ -205,3 +205,27 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
func (a *API) AccessAPI(cmd string, isGet bool, bizParams map[string]interface{}) (retVal interface{}, err error) {
return a.AccessAPI2(cmd, isGet, bizParams, resultKeyData, "")
}
func (a *API) GetOAuthCode(appPoiCode string) (retVal interface{}, err error) {
retVal, err = a.AccessAPI2("oauth/authorize", true, map[string]interface{}{
"app_poi_code": appPoiCode,
"response_type": "code",
}, "code", "")
return retVal, err
}
func (a *API) GetAccessToken(code string) (retVal interface{}, err error) {
retVal, err = a.AccessAPI2("oauth/token", false, map[string]interface{}{
"grant_type": "authorization_code",
"code": code,
}, "access_token", "")
return retVal, err
}
func (a *API) RefreshToken(code string) (retVal interface{}, err error) {
retVal, err = a.AccessAPI2("oauth/token", false, map[string]interface{}{
"grant_type": "authorization_code",
"code": code,
}, "access_token", "")
return retVal, err
}