Documentation
¶
Index ¶
- func AuthCodeURL(appId, componentAppId, redirectURI, scope, state string) string
- func GetSession(Endpoint *Endpoint, code string) (session *mpoauth2.Session, err error)
- func GetSessionWithClient(Endpoint *Endpoint, code string, httpClient *http.Client) (session *mpoauth2.Session, err error)
- type Endpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthCodeURL ¶
AuthCodeURL 生成网页授权地址.
appId: 公众号的唯一标识 componentAppId: 服务方的appid,在申请创建公众号服务成功后,可在公众号服务详情页找到 redirectURI: 授权后重定向的回调链接地址 scope: 应用授权作用域 state: 重定向后会带上 state 参数, 开发者可以填写 a-zA-Z0-9 的参数值, 最多128字节
func GetSession ¶
GetSession 获取小程序会话
Types ¶
type Endpoint ¶
Endpoint 实现了 wechat.v2/oauth2.Endpoint 接口.
func NewEndpoint ¶
func (*Endpoint) ExchangeTokenURL ¶
func (*Endpoint) LoginUrl ¶
func (p *Endpoint) LoginUrl(preAuthCode string, redirectUri string, authType uint, bizAppId string) string
要授权的帐号类型, 1则商户扫码后,手机端仅展示公众号、2表示仅展示小程序,3表示公众号和小程序都展示。如果为未制定,则默认小程序和公众号都展示。第三方平台开发者可以使用本字段来控制授权的帐号类型。
func (*Endpoint) RefreshTokenURL ¶
func (*Endpoint) SessionCodeUrl ¶
Click to show internal directories.
Click to hide internal directories.