fix: 登录去掉后端格式校验

pull/185/head
ssongliu 2023-03-06 17:57:45 +08:00 committed by ssongliu
parent 9bbad95c04
commit a195b8b69f
2 changed files with 5 additions and 9 deletions

View File

@ -28,10 +28,6 @@ func (b *BaseApi) Login(c *gin.Context) {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := global.VALID.Struct(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := captcha.VerifyCode(req.CaptchaID, req.Captcha); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return

View File

@ -18,17 +18,17 @@ type MfaCredential struct {
}
type Login struct {
Name string `json:"name" validate:"name,required"`
Password string `json:"password" validate:"required"`
Name string `json:"name"`
Password string `json:"password"`
Captcha string `json:"captcha"`
CaptchaID string `json:"captchaID"`
AuthMethod string `json:"authMethod"`
}
type MFALogin struct {
Name string `json:"name" validate:"name,required"`
Password string `json:"password" validate:"required"`
Secret string `json:"secret" validate:"required"`
Name string `json:"name"`
Password string `json:"password"`
Secret string `json:"secret"`
Code string `json:"code"`
AuthMethod string `json:"authMethod"`
}