This commit is contained in:
richboo111
2023-07-03 17:00:10 +08:00
parent 41ce1bc7e5
commit 8f9b8071a2
3 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
)
type SNSTokenInfo struct {
@@ -84,6 +85,7 @@ func mapData2SNSToken(result map[string]interface{}) *SNSTokenInfo {
func (a *API) SNSRetrieveToken(code string) (tokenInfo *SNSTokenInfo, err error) {
result, err := a.AccessAPI("sns/oauth2/access_token", utils.Params2Map("grant_type", "authorization_code", "code", code), "")
if err != nil {
globals.SugarLogger.Debugf("SNSRetrieveToken err=%v", err)
return nil, err
}
return mapData2SNSToken(result), nil