Documentation
¶
Index ¶
Constants ¶
View Source
const ( PlatformHand = "hand" //手动添加 PlatformMobile = "mobile" //手机一键登录 PlatformSms = "sms" //手机短信 PlatformWxMini = "wx_mini" //微信小程序 PlatformBaiduMini = "baidu_mini" //百度小程序 PlatformAlipayMini = "alipay_mini" //支付宝小程序 PlatformDouYinMini = "douyin_mini" //抖音小程序 PlatformWechat = "weixin" //微信登录(APP通过微信登录) PlatformQQ = "qq" //QQ登录 PlatformAlipay = "alipay" //支付宝登录 PlatformDouYin = "douyin" //抖音登录 PlatformWeibo = "weibo" //微博登录 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Oauth ¶
type Oauth interface { GetName() string GetAuthLoginUrl(state string) string GetAuthUserInfo(code string) (*UserResult, error) }
获取第三方登录地址
type OauthConfig ¶
type OauthConfig struct { ClientId string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectUri string `json:"redirect_uri"` }
基本配置
type Option ¶
type Option func(*OauthConfig)
func WithClientID ¶
func WithClientSecret ¶
func WithRedirectUri ¶
type UserResult ¶
type UserResult struct { OpenId string `json:"open_id"` // 用户在开放平台的唯一标识 NickName string `json:"nick_name"` // 用户昵称 Name string `json:"name"` // 用户姓名 EnName string `json:"en_name"` // 用户英文名 Avatar string `json:"avatar_url"` // 头像URL Email string `json:"email"` // 邮箱 Mobile string `json:"mobile"` // 手机号码 }
Click to show internal directories.
Click to hide internal directories.