Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCodeIsSuccess int64 = 0
ErrCodeIsSuccess 微信接口请求返回成功
Functions ¶
func GetAccessToken ¶
func GetAccessToken(appId, appSecret string) (data ResponseAccessTokenData, errData ResponseErrorData, err error)
GetAccessToken 获取AccessToken
Types ¶
type PhoneInfoData ¶
type PhoneInfoData struct { PhoneNumber string `json:"phoneNumber"` PurePhoneNumber string `json:"purePhoneNumber"` CountryCode string `json:"countryCode"` Watermark WatermarkData `json:"watermark"` }
type ResponseAccessTokenData ¶
type ResponseAccessTokenData struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResponseAccessTokenData 返回access_token数据
type ResponseCode2SessionData ¶
type ResponseCode2SessionData struct { ErrCode int64 `json:"errcode"` ErrMsg string `json:"errmsg"` OpenId string `json:"openid"` UnionId string `json:"unionid"` SessionKey string `json:"session_key"` }
ResponseCode2SessionData 返回小程序登录凭证校验
func GetCode2Session ¶
func GetCode2Session(appId, appSecret, jsCode string, grantTypes ...string) (data ResponseCode2SessionData, err error)
GetCode2Session 登录凭证校验
type ResponseErrorData ¶
ResponseErrorData 请求返回错误时的数据
type ResponsePhoneNumberData ¶
type ResponsePhoneNumberData struct { ErrCode int64 `json:"errcode"` ErrMsg string `json:"errmsg"` PhoneInfo PhoneInfoData `json:"phone_info"` }
ResponsePhoneNumberData 返回小程序的用户手机号码
func GetPhoneNumber ¶
func GetPhoneNumber(code, accessToken string) (data ResponsePhoneNumberData, err error)
GetPhoneNumber 获取小程序的用户手机号
type WatermarkData ¶
Click to show internal directories.
Click to hide internal directories.