@@ -121,7 +121,7 @@ func (uc *UserController) UserEmailLogin(ctx *gin.Context) {
121121
122122 resp , err := uc .userService .EmailLogin (ctx , req )
123123 if err != nil {
124- _ , _ = uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionEmail , ctx .ClientIP ())
124+ _ , _ = uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionPassword , ctx .ClientIP ())
125125 errFields := append ([]* validator.FormErrorField {}, & validator.FormErrorField {
126126 ErrorField : "e_mail" ,
127127 ErrorMsg : translator .Tr (handler .GetLang (ctx ), reason .EmailOrPasswordWrong ),
@@ -541,8 +541,10 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
541541 return
542542 }
543543 isAdmin := middleware .GetUserIsAdminModerator (ctx )
544+
544545 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 )
546548 if ! captchaPass {
547549 errFields := append ([]* validator.FormErrorField {}, & validator.FormErrorField {
548550 ErrorField : "captcha_code" ,
@@ -552,14 +554,16 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
552554 return
553555 }
554556 }
557+
555558 resp , err := uc .userService .UserChangeEmailSendCode (ctx , req )
556559 if err != nil {
557560 handler .HandleResponse (ctx , err , resp )
558561 return
559562 }
560563 if ! isAdmin {
561- uc .actionService .ActionRecordAdd (ctx , entity .CaptchaActionPassword , req . UserID )
564+ uc .actionService .ActionRecordDel (ctx , entity .CaptchaActionEditUserinfo , ctx . ClientIP () )
562565 }
566+
563567 handler .HandleResponse (ctx , err , nil )
564568}
565569
0 commit comments