wxlogin
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user