Documentation ¶
Index ¶
- Constants
- func Init(dbOrm *gorm.DB) error
- func UpdateUserInfoByWxMiniApp(ctx context.Context, wxConfig *wechat.WxConfig, reqData *userInfoUpdateReqData) error
- func UserDaoInst() *model.UserDao
- type LoginMobileParams
- type LoginQQParams
- type LoginRequest
- type LoginResponse
- type LoginWxParams
- type SessHelper
Constants ¶
View Source
const ( // LoginWxMiniApp login by wx app LoginWxMiniApp = "wx_miniapp" // LoginByWxH5 login by wx h5 LoginByWxH5 = "wx_h5" // LoginByWxQr login by wx qr LoginByWxQr = "wx_qr" // LoginByWxApp login by wx app LoginByWxApp = "wx_app" // LoginByMobile login by wx app LoginByMobile = "mobile" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoginMobileParams ¶
type LoginMobileParams struct { Phone string `json:"phone"` // 手机号 Code string `json:"code"` // 验证码 CodeType string `json:"type"` // 验证码序列号 }
LoginMobileParams args
type LoginQQParams ¶
type LoginQQParams struct {
AccessToken string `json:"access_token"`
}
LoginQQParams args
type LoginRequest ¶
type LoginRequest struct { InviterId string `json:"inviter_uuid"` InviteScene string `json:"invite_scene"` InvitePayload json.RawMessage `json:"invite_payload,omitempty"` Platform string `json:"platform"` LoginType string `json:"login_type"` // 登录方式 WX LoginWxParams `json:"wx"` // 微信登录 QQ LoginQQParams `json:"qq"` // QQ登录 Mobile LoginMobileParams `json:"mobile"` // 手机登录 }
LoginRequest args
type LoginResponse ¶
type LoginResponse struct { Uuid string `json:"uuid"` NewUser int `json:"new_user"` Token string `json:"token"` }
LoginResponse ...
func Login ¶
func Login(ctx context.Context, req *LoginRequest) (resp *LoginResponse, err error)
Login login
func LoginByWxMiniApp ¶
func LoginByWxMiniApp(ctx context.Context, appid, appname, appsecret, jsCode, inviter string) (*LoginResponse, error)
LoginByWxMiniApp authorizate and register wechat user
type LoginWxParams ¶
type LoginWxParams struct {
Code string `json:"code" yaml:"code"`
}
LoginWxParams args
type SessHelper ¶
type SessHelper struct {
// contains filtered or unexported fields
}
SessHelper with this object, we can handle the uuid and token conveniently
func SessHelperInst ¶
func SessHelperInst() *SessHelper
SessHelperInst the global instance for SessHelper
func (*SessHelper) DeleteToken ¶
func (s *SessHelper) DeleteToken(appid, uuid string) error
DeleteToken delete the current token of uuid
func (*SessHelper) GetToken ¶
func (s *SessHelper) GetToken(appid, uuid string) (string, error)
GetToken get the token for uuid
func (*SessHelper) UpdateToken ¶
func (s *SessHelper) UpdateToken(appid, uuid, token string, expireMS int) error
UpdateToken update the token for uuid
Source Files ¶
Click to show internal directories.
Click to hide internal directories.