oauth

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 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 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) 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