oauth

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

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) 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"`
}

ResUserInfo 返回得用户信息

Jump to

Keyboard shortcuts

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