代码拉取完成,页面将自动刷新
package app3
import (
"gitee.com/h79/gothird/token/access"
)
type PreAuthCode struct {
Code string `json:"pre_auth_code"`
ExpiresIn int64 `json:"expires_in"`
}
// Info 获取授权方的帐号基本信息
type Info struct {
Info map[string]interface{} `json:"authorizer_info"`
}
type Authorization struct {
Appid string `json:"authorizer_appid"`
AccessToken string `json:"authorizer_access_token"`
ExpiresIn int64 `json:"expires_in"`
RefreshToken string `json:"authorizer_refresh_token"`
}
type FuncInfo struct {
Func []interface{} `json:"func_info"`
}
type AInfo struct {
Authorization
FuncInfo
}
type AuthorizationInfo struct {
Info AInfo `json:"authorization_info"`
}
// GetAccessToken access.Token interface implement
func (a AuthorizationInfo) GetAccessToken() access.Value {
return access.Value{
Data: a.Info.AccessToken,
ExpireIn: access.ExpireSecond(a.Info.ExpiresIn),
}
}
func (a AuthorizationInfo) GetRefAccessToken() access.Value {
return access.Value{
Data: a.Info.RefreshToken,
ExpireIn: access.RefExpireSecond(0),
}
}
type ListAuthInfo struct {
TotalCount int `json:"total_count"`
List []Auth `json:"list"`
}
type Auth struct {
AuthorizerAppId string `json:"authorizer_appid"`
AuthorizerRefreshToken string `json:"refresh_token"`
AuthTime int64 `json:"auth_time"`
}
type AuthorizerToken struct {
AuthorizerAppId string `json:"authorizer_appid,omitempty"`
AcsToken string `json:"authorizer_access_token"`
ExpireIn int64 `json:"expires_in"`
RefToken string `json:"authorizer_refresh_token"`
RefExpireIn int64 `json:"authorizer_refresh_expires_in,omitempty"`
}
// GetAccessToken access.Token interface implement
func (a AuthorizerToken) GetAccessToken() access.Value {
return access.Value{
Data: a.AcsToken,
ExpireIn: access.ExpireSecond(a.ExpireIn),
}
}
func (a AuthorizerToken) GetRefAccessToken() access.Value {
return access.Value{
Data: a.RefToken,
ExpireIn: access.RefExpireSecond(a.RefExpireIn),
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。