@@ -121,7 +121,7 @@ func (uc *UserController) UserEmailLogin(ctx *gin.Context) {
121
121
122
122
resp , err := uc .userService .EmailLogin (ctx , req )
123
123
if err != nil {
124
- _ , _ = uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionEmail , ctx .ClientIP ())
124
+ _ , _ = uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionPassword , ctx .ClientIP ())
125
125
errFields := append ([]* validator.FormErrorField {}, & validator.FormErrorField {
126
126
ErrorField : "e_mail" ,
127
127
ErrorMsg : translator .Tr (handler .GetLang (ctx ), reason .EmailOrPasswordWrong ),
@@ -541,8 +541,10 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
541
541
return
542
542
}
543
543
isAdmin := middleware .GetUserIsAdminModerator (ctx )
544
+
544
545
if ! isAdmin {
545
- captchaPass := uc .actionService .ActionRecordVerifyCaptcha (ctx , entity .CaptchaActionPassword , req .UserID , req .CaptchaID , req .CaptchaCode )
546
+ captchaPass := uc .actionService .ActionRecordVerifyCaptcha (ctx , entity .CaptchaActionEditUserinfo , req .UserID , req .CaptchaID , req .CaptchaCode )
547
+ uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionEditUserinfo , req .UserID )
546
548
if ! captchaPass {
547
549
errFields := append ([]* validator.FormErrorField {}, & validator.FormErrorField {
548
550
ErrorField : "captcha_code" ,
@@ -552,14 +554,16 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
552
554
return
553
555
}
554
556
}
557
+
555
558
resp , err := uc .userService .UserChangeEmailSendCode (ctx , req )
556
559
if err != nil {
557
560
handler .HandleResponse (ctx , err , resp )
558
561
return
559
562
}
560
563
if ! isAdmin {
561
- uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionPassword , req . UserID )
564
+ uc .actionService .ActionRecordDel (ctx , entity .CaptchaActionEditUserinfo , ctx . ClientIP () )
562
565
}
566
+
563
567
handler .HandleResponse (ctx , err , nil )
564
568
}
565
569
0 commit comments