mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-06 17:08:29 +08:00
FORGOT_PASSWORD log
This commit is contained in:
parent
50a3c40b88
commit
3e94c7ae64
@ -19,8 +19,8 @@ package org.dromara.maxkey.web.contorller;
|
||||
|
||||
import org.dromara.maxkey.authn.annotation.CurrentUser;
|
||||
import org.dromara.maxkey.constants.ConstsEntryType;
|
||||
import org.dromara.maxkey.constants.ConstsOperateAction;
|
||||
import org.dromara.maxkey.constants.ConstsOperateResult;
|
||||
import org.dromara.maxkey.constants.ConstsAct;
|
||||
import org.dromara.maxkey.constants.ConstsActResult;
|
||||
import org.dromara.maxkey.constants.ConstsPasswordSetType;
|
||||
import org.dromara.maxkey.entity.ChangePassword;
|
||||
import org.dromara.maxkey.entity.Message;
|
||||
@ -80,13 +80,13 @@ public class ChangePasswodController {
|
||||
systemLog.insert(
|
||||
ConstsEntryType.USERINFO,
|
||||
changePassword,
|
||||
ConstsOperateAction.CHANGE_PASSWORD,
|
||||
ConstsOperateResult.SUCCESS,
|
||||
ConstsAct.CHANGE_PASSWORD,
|
||||
ConstsActResult.SUCCESS,
|
||||
currentUser);
|
||||
return new Message<ChangePassword>().buildResponse();
|
||||
}else {
|
||||
String message = (String) WebContext.getAttribute(PasswordPolicyValidator.PASSWORD_POLICY_VALIDATE_RESULT);
|
||||
logger.info("-message:",message);
|
||||
logger.info("-message: {}",message);
|
||||
return new Message<ChangePassword>(Message.ERROR,message).buildResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,9 @@ import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.maxkey.authn.jwt.AuthTokenService;
|
||||
import org.dromara.maxkey.configuration.EmailConfig;
|
||||
import org.dromara.maxkey.constants.ConstsEntryType;
|
||||
import org.dromara.maxkey.constants.ConstsAct;
|
||||
import org.dromara.maxkey.constants.ConstsActResult;
|
||||
import org.dromara.maxkey.entity.ChangePassword;
|
||||
import org.dromara.maxkey.entity.Message;
|
||||
import org.dromara.maxkey.entity.PasswordPolicy;
|
||||
@ -29,6 +32,7 @@ import org.dromara.maxkey.entity.UserInfo;
|
||||
import org.dromara.maxkey.password.onetimepwd.AbstractOtpAuthn;
|
||||
import org.dromara.maxkey.password.onetimepwd.MailOtpAuthnService;
|
||||
import org.dromara.maxkey.password.sms.SmsOtpAuthnService;
|
||||
import org.dromara.maxkey.persistence.service.HistorySystemLogsService;
|
||||
import org.dromara.maxkey.persistence.service.PasswordPolicyService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
@ -82,6 +86,8 @@ public class ForgotPasswordContorller {
|
||||
@Autowired
|
||||
SmsOtpAuthnService smsOtpAuthnService;
|
||||
|
||||
@Autowired
|
||||
HistorySystemLogsService historySystemLogsService;
|
||||
|
||||
@Autowired
|
||||
private PasswordPolicyService passwordPolicyService;
|
||||
@ -195,6 +201,12 @@ public class ForgotPasswordContorller {
|
||||
) {
|
||||
|
||||
if(userInfoService.changePassword(changePassword,true)) {
|
||||
historySystemLogsService.insert(
|
||||
ConstsEntryType.USERINFO,
|
||||
changePassword,
|
||||
ConstsAct.FORGOT_PASSWORD,
|
||||
ConstsActResult.SUCCESS,
|
||||
loadedUserInfo);
|
||||
return new Message<ChangePassword>(Message.SUCCESS).buildResponse();
|
||||
}else {
|
||||
return new Message<ChangePassword>(Message.FAIL).buildResponse();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user