Documentation ¶
Index ¶
- Variables
- func AdminLogin(ctx *gin.Context)
- func Captcha(ctx *gin.Context)
- func CleanToken(authorityType int, userId string) error
- func Clear(ctx *gin.Context)
- func DelToken(token string) error
- func Group(group *gin.RouterGroup)
- func Logout(ctx *gin.Context)
- type LoginRequest
- type LoginResponse
- type MiniCodeResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNameOrPassword = errors.New("用户名或密码错误") ErrCaptcha = errors.New("验证码错误") )
Functions ¶
Types ¶
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" form:"username" binding:"required"` Password string `json:"password" form:"password" binding:"required"` Captcha string `json:"captcha" form:"captcha" binding:"dev-required"` CaptchaId string `json:"captchaId" form:"captchaId" binding:"dev-required"` AuthorityType int `json:"authorityType" ` }
LoginRequest 登录
type LoginResponse ¶
type LoginResponse struct { User interface{} `json:"user"` Token string `json:"accessToken"` }
func GetAccessToken ¶
func GetAccessToken(req *LoginRequest) (*LoginResponse, error)
GetAccessToken 登录
type MiniCodeResponse ¶
Click to show internal directories.
Click to hide internal directories.