Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConnectWechatServer = errors.New("err connect Wechat server")
)
Functions ¶
func RefreshTokenURL ¶
func UserInfoURL ¶
Types ¶
type AccessToken ¶
type AccessToken struct {
CommonResponse
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
Openid string `json:"openid"`
Scope string `json:"scope"`
Unionid string `json:"unionid,omitempty"`
}
func GetAccessToken ¶
func GetAccessToken(appId, appSecret, code string) (ak AccessToken, err error)
func RefreshToken ¶
func RefreshToken(appId, refreshToken string) (ak AccessToken, err error)
type CommonResponse ¶
type UserInfo ¶
type UserInfo struct {
CommonResponse
Openid string `json:"openid"`
Nickname string `json:"nickname"`
Sex int `json:"sex"` // 普通用户性别,1为男性,2为女性
Language string `json:"language"`
City string `json:"city"`
Province string `json:"province"`
Country string `json:"country"`
Headimgurl string `json:"headimgurl,omitempty"`
Privilege []string `json:"privilege"`
Unionid string `json:"unionid"`
}
func GetUserInfo ¶
Click to show internal directories.
Click to hide internal directories.