Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLoginRoutes ¶ added in v0.0.145
Types ¶
type Controller ¶ added in v0.0.145
type Controller struct{}
func (*Controller) LoginByPassword ¶ added in v0.0.145
func (lc *Controller) LoginByPassword(c *response.Context)
验证用户名和密码 1、从cfg中获取用户名,先判断是不是admin,是进行密码比对.必须启用临时管理员配置才进行这一步 2、从DB中获取用户名密码 @Summary 用户登录 @Description 用户通过用户名、密码和2FA验证码登录,支持普通和LDAP登录 @Param username body string true "用户名" @Param password body string true "密码(加密)" @Param loginType body int false "登录类型 0:普通 1:LDAP" @Param code body string false "2FA验证码" @Success 200 {object} string "登录成功,返回JWT Token" @Failure 401 {object} string "登录失败" @Router /auth/login [post]
Click to show internal directories.
Click to hide internal directories.