Documentation
¶
Index ¶
Constants ¶
View Source
const ( ScopeSnsBase = "snsapi_base" ScopeSnsInfo = "snsapi_userinfo" )
scope 静默授权与用户授权
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessToken ¶
type AccessToken interface {
// contains filtered or unexported methods
}
AccessToken 全局token
func NewAccessToken ¶
func NewAccessToken() AccessToken
type Authorize ¶
type Authorize interface {
// SnsApiBase 静默授权
SnsApiBase(redirectUri, state string) (string, error)
// SnsApiUserInfo 用户授权
SnsApiUserInfo(redirectUri, state string) (string, error)
// SnsAccessToken code换取access_token
SnsAccessToken(code string) (AuthorizeDTO, error)
// SnsAuthAccessToken 验证access_token
SnsAuthAccessToken() error
// SnsRefreshToken 刷新access_token
SnsRefreshToken() (AuthorizeDTO, error)
// SnsUserInfo 拉取用户信息
SnsUserInfo() (UserInfoDTO, error)
}
Authorize 网页授权相关接口
func NewAuthorize ¶
func NewAuthorize() Authorize
type AuthorizeDTO ¶
type JsapiTicket ¶
type JsapiTicket interface {
GetJsSdk(url string) JsSdkDTO
// contains filtered or unexported methods
}
func NewJsapiTicket ¶
func NewJsapiTicket() JsapiTicket
type UserInfoDTO ¶
type UserInfoDTO struct {
Openid string `json:"openid"`
Nickname string `json:"nickname"`
Sex int `json:"sex"`
Province string `json:"province"`
City string `json:"city"`
Country string `json:"country"`
Headimgurl string `json:"headimgurl"`
Privilege []string `json:"privilege"`
Unionid string `json:"unionid"`
}
Click to show internal directories.
Click to hide internal directories.