qq

package
v0.0.0-...-d2c9018 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthQq

type AuthQq struct {
	Config *oauth.AuthConfig
	oauth.AuthOauthURL
}

QQ授权登录

func NewAuthQq

func NewAuthQq(conf *oauth.AuthConfig) *AuthQq

func (*AuthQq) GetAccessToken

func (a *AuthQq) GetAccessToken(code string) (resp *TokenResult, err error)

获取token

func (*AuthQq) GetAuthorizeUrl

func (a *AuthQq) GetAuthorizeUrl(state string) string

获取登录地址

func (*AuthQq) GetName

func (a *AuthQq) GetName() string

func (*AuthQq) GetOpenid

func (a *AuthQq) GetOpenid(accessToken string) (resp *OpenResult, err error)

获取用户openid

func (*AuthQq) GetUserInfo

func (a *AuthQq) GetUserInfo(accessToken string, openId string) (resp *UserResult, err error)

获取第三方用户信息 https://wiki.connect.qq.com/get_user_info

func (*AuthQq) GetUserOpenInfo

func (a *AuthQq) GetUserOpenInfo(code string) (resp *oauth.UserResult, err error)

func (*AuthQq) RefreshToken

func (a *AuthQq) RefreshToken(refreshToken string) (resp *RefreshResult, err error)

刷新token

type ErrResult

type ErrResult struct {
	Error            int    `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type OpenResult

type OpenResult struct {
	OpenId  string `json:"openId"`
	Unionid string `json:"unionid"`
}

临时票据结果

type RefreshResult

type RefreshResult struct {
	AccessToken  string `json:"access_token" example:"30F378110D9E34CFE04EDF183165D0D0"`
	ExpiresIn    string `json:"expires_in" example:"7776000"`
	RefreshToken string `json:"refresh_token" example:"9AEA28A71B91AF087CB6D3986BA62D24"`
}

type TokenResult

type TokenResult struct {
	AccessToken  string `json:"access_token" example:"30F378110D9E34CFE04EDF183165D0D0"`
	ExpiresIn    string `json:"expires_in" example:"7776000"`
	RefreshToken string `json:"refresh_token" example:"9AEA28A71B91AF087CB6D3986BA62D24"`
}

type UserResult

type UserResult struct {
	Ret           int    `json:"ret" example:"0"`
	Msg           string `json:"msg" example:""`
	IsLost        int    `json:"is_lost" example:"0"`
	Nickname      string `json:"nickname" example:"静闻弦语"`
	FigureURL     string `json:"figureurl" example:"http://qzapp.qlogo.cn/qzapp/101993700/0661AA6B4844909CCF75C391A6DDB45A/30"`
	FigureURL1    string `json:"figureurl_1" example:"http://qzapp.qlogo.cn/qzapp/101993700/0661AA6B4844909CCF75C391A6DDB45A/50"`
	FigureURL2    string `json:"figureurl_2" example:"http://qzapp.qlogo.cn/qzapp/101993700/0661AA6B4844909CCF75C391A6DDB45A/100"`
	FigureURLQQ1  string `json:"figureurl_qq_1" example:"http://thirdqq.qlogo.cn/g?b=oidb&k=rgN0sF9KSaOsJhuJp0noZg&kti=ZXLrrAAAAAE&s=40&t=1644466423"`
	FigureURLQQ2  string `json:"figureurl_qq_2" example:"http://thirdqq.qlogo.cn/g?b=oidb&k=rgN0sF9KSaOsJhuJp0noZg&kti=ZXLrrAAAAAE&s=100&t=1644466423"`
	FigureURLQQ   string `json:"figureurl_qq" example:"http://thirdqq.qlogo.cn/g?b=oidb&k=rgN0sF9KSaOsJhuJp0noZg&kti=ZXLrrAAAAAE&s=640&t=1644466423"`
	FigureURLType string `json:"figureurl_type" example:"1"`
}

Jump to

Keyboard shortcuts

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