mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-12-01 17:43:16 +00:00
@@ -152,6 +152,10 @@ var loginLimiter = NewLoginLimiter(3, 5*time.Minute)
|
||||
// @Router /admin/login [post]
|
||||
// @Security token
|
||||
func (ct *Login) Login(c *gin.Context) {
|
||||
if global.Config.App.DisablePwdLogin {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "PwdLoginDisabled"))
|
||||
return
|
||||
}
|
||||
f := &admin.Login{}
|
||||
err := c.ShouldBindJSON(f)
|
||||
clientIp := c.ClientIP()
|
||||
|
||||
@@ -27,6 +27,10 @@ type Login struct {
|
||||
// @Failure 500 {object} response.ErrorResponse
|
||||
// @Router /login [post]
|
||||
func (l *Login) Login(c *gin.Context) {
|
||||
if global.Config.App.DisablePwdLogin {
|
||||
response.Error(c, response.TranslateMsg(c, "PwdLoginDisabled"))
|
||||
return
|
||||
}
|
||||
f := &api.LoginForm{}
|
||||
err := c.ShouldBindJSON(f)
|
||||
//fmt.Println(f)
|
||||
|
||||
Reference in New Issue
Block a user