component

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthCodeURL

func AuthCodeURL(appId, componentAppId, redirectURI, scope, state string) string

AuthCodeURL 生成网页授权地址.

appId:          公众号的唯一标识
componentAppId: 服务方的appid,在申请创建公众号服务成功后,可在公众号服务详情页找到
redirectURI:    授权后重定向的回调链接地址
scope:          应用授权作用域
state:          重定向后会带上 state 参数, 开发者可以填写 a-zA-Z0-9 的参数值, 最多128字节

Types

type Endpoint

type Endpoint struct {
	AppId                string
	ComponentAppId       string
	ComponentAccessToken string
}

Endpoint 实现了 wechat.v2/oauth2.Endpoint 接口.

func NewEndpoint

func NewEndpoint(appId, componentAppId, componentAccessToken string) *Endpoint

func (*Endpoint) ExchangeTokenURL

func (p *Endpoint) ExchangeTokenURL(code string) string

func (*Endpoint) RefreshTokenURL

func (p *Endpoint) RefreshTokenURL(refreshToken string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL