This commit is contained in:
邹宗楠
2024-07-11 14:29:44 +08:00
parent a75db22cb4
commit 21beb9ae6e
9 changed files with 38 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import (
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable/sdk"
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable/sdk/ability304"
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable/sdk/ability304/request"
"git.rosy.net.cn/jx-callback/globals"
)
const (
@@ -65,3 +66,21 @@ func (a *API) GetStoreToken(code, uuId string) (*StoreTokenInfo, error) {
}
return token, err
}
func (a *API) GetRefreshToken(refreshToken string) (*StoreTokenInfo, error) {
param := &request.TaobaoTopAuthTokenRefreshRequest{
RefreshToken: &refreshToken,
}
data, err := ability304.NewAbility304(&a.client).TaobaoTopAuthTokenRefresh(param)
if err != nil {
return nil, err
}
globals.SugarLogger.Debugf("=====data.TokenResult := %s", data.TokenResult)
globals.SugarLogger.Debugf("=====data.Body := %s", data.Body)
var token *StoreTokenInfo
if err := json.Unmarshal([]byte(data.TokenResult), &token); err != nil {
return nil, err
}
return token, err
}