oauth

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserDetailRequest added in v2.1.6

type GetUserDetailRequest struct {
	UserTicket string `json:"user_ticket"`
}

GetUserDetailRequest 获取访问用户敏感信息请求

type GetUserDetailResponse added in v2.1.6

type GetUserDetailResponse struct {
	util.CommonError
	UserID  string `json:"userid"`
	Gender  string `json:"gender"`
	Avatar  string `json:"avatar"`
	QrCode  string `json:"qr_code"`
	Mobile  string `json:"mobile"`
	Email   string `json:"email"`
	BizMail string `json:"biz_mail"`
	Address string `json:"address"`
}

GetUserDetailResponse 获取访问用户敏感信息响应

type GetUserInfoResponse added in v2.1.6

type GetUserInfoResponse struct {
	util.CommonError
	UserID         string `json:"userid"`
	UserTicket     string `json:"user_ticket"`
	OpenID         string `json:"openid"`
	ExternalUserID string `json:"external_userid"`
}

GetUserInfoResponse 获取访问用户身份&获取用户登录身份响应

type Oauth

type Oauth struct {
	*context.Context
}

Oauth auth

func NewOauth

func NewOauth(ctx *context.Context) *Oauth

NewOauth new init oauth

func (*Oauth) GetQrContentTargetURL

func (ctr *Oauth) GetQrContentTargetURL(callbackURL string) string

GetQrContentTargetURL 构造独立窗口登录二维码

func (*Oauth) GetTargetPrivateURL added in v2.1.4

func (ctr *Oauth) GetTargetPrivateURL(callbackURL string, agentID string) string

GetTargetPrivateURL 获取个人信息授权地址

func (*Oauth) GetTargetURL

func (ctr *Oauth) GetTargetURL(callbackURL string) string

GetTargetURL 获取授权地址

func (*Oauth) GetUserDetail added in v2.1.6

func (ctr *Oauth) GetUserDetail(req *GetUserDetailRequest) (*GetUserDetailResponse, error)

GetUserDetail 获取访问用户敏感信息 @see https://developer.work.weixin.qq.com/document/path/95833

func (*Oauth) GetUserInfo added in v2.1.6

func (ctr *Oauth) GetUserInfo(code string) (*GetUserInfoResponse, error)

GetUserInfo 获取访问用户身份&获取用户登录身份 @see https://developer.work.weixin.qq.com/document/path/90213 获取访问用户身份 @see https://developer.work.weixin.qq.com/document/path/98176 获取用户登录身份

func (*Oauth) UserFromCode

func (ctr *Oauth) UserFromCode(code string) (result ResUserInfo, err error)

UserFromCode 根据code获取用户信息

type ResUserInfo

type ResUserInfo struct {
	util.CommonError
	// 当用户为企业成员时返回
	UserID   string `json:"UserId"`
	DeviceID string `json:"DeviceId"`
	// 非企业成员授权时返回
	OpenID         string `json:"OpenId"`
	ExternalUserID string `json:"external_userid"`
}

ResUserInfo 返回得用户信息

Jump to

Keyboard shortcuts

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