thirdPartyLogin

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToMap

func ConvertToMap(str string) map[string]string

url 转 map

Types

type WebQQLogin

type WebQQLogin struct {
	AppId       string
	AppKey      string
	RedirectURI string
	StatePrefix string
}

func (*WebQQLogin) GetOpenId added in v1.5.3

func (m *WebQQLogin) GetOpenId(token string, code string) (string, error)

获取 openId

func (*WebQQLogin) GetToken added in v1.5.3

func (m *WebQQLogin) GetToken(code string) (map[string]string, error)

获取 toen

func (*WebQQLogin) GetUser added in v1.5.3

func (m *WebQQLogin) GetUser(ctx *gin.Context, session sessions.Session) (map[string]any, error)

解析返回数据

func (*WebQQLogin) Login added in v1.5.3

func (m *WebQQLogin) Login(ctx *gin.Context, session sessions.Session)

跳转到 QQ 登陆

type WebWXLogin added in v1.3.3

type WebWXLogin struct {
	AppId       string
	AppSecret   string
	RedirectURI string
	StatePrefix string
}

func (*WebWXLogin) Back added in v1.5.3

func (m *WebWXLogin) Back(ctx *gin.Context, session sessions.Session) (WebWXUserInfo, error)

授权后返回处理

func (*WebWXLogin) Login added in v1.5.3

func (m *WebWXLogin) Login(ctx *gin.Context, session sessions.Session)

跳转到微信扫码登陆

type WebWXToken added in v1.3.3

type WebWXToken struct {
	AccessToken string `json:"access_token"`
	Openid      string `json:"openid"`
	Unionid     string `json:"unionid"`
	Errcode     int    `json:"errcode"`
}

type WebWXUserInfo added in v1.3.3

type WebWXUserInfo struct {
	HeadImgUrl string `json:"headimgurl"`
	Openid     string `json:"openid"`
	Unionid    string `json:"unionid"`
	Nickname   string `json:"nickname"`
	Errcode    int    `json:"errcode"`
}

Jump to

Keyboard shortcuts

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