|
@@ -133,17 +133,9 @@ public class MdeEnterpriseAuthServiceImpl implements MdeEnterpriseAuthService {
|
|
|
createLoginLog(null, email, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);
|
|
|
throw exception(MDE_USER_EMAIL_NOT_REGISTERED);
|
|
|
}
|
|
|
-
|
|
|
if (!userBindService.isPasswordMatch(password, user.getPassword())) {
|
|
|
- createLoginLog(user.getId(), email, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);
|
|
|
- throw exception(MDE_AUTH_LOGIN_BAD_CREDENTIALS);
|
|
|
-
|
|
|
- }
|
|
|
- // 校验是否禁用
|
|
|
- if (ObjectUtil.notEqual(user.getStatus(), MendunerStatusEnum.ENABLE.getStatus())) {
|
|
|
- createLoginLog(user.getId(), email, logTypeEnum, LoginResultEnum.USER_DISABLED);
|
|
|
// 只有输错密码并且是首次才需要发邮箱告诉密码
|
|
|
- if (userBindService.checkNeedUpdatePassword(user.getEnterpriseId(), user.getUserId())) {
|
|
|
+ if (null == user.getLoginDate()) {
|
|
|
// 效验有没有更改过密码
|
|
|
// 没有则发送邮箱
|
|
|
MailSendSingleToUserReqDTO reqDTO = new MailSendSingleToUserReqDTO();
|
|
@@ -153,9 +145,16 @@ public class MdeEnterpriseAuthServiceImpl implements MdeEnterpriseAuthService {
|
|
|
mailSendApi.sendSingleMailToMember(reqDTO).getCheckedData();
|
|
|
throw exception(MDE_USER_EMAIL_INIT_PASSWORD);
|
|
|
} else {
|
|
|
- throw exception(MDE_AUTH_LOGIN_USER_DISABLED);
|
|
|
+ createLoginLog(user.getId(), email, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);
|
|
|
+ throw exception(MDE_AUTH_LOGIN_BAD_CREDENTIALS);
|
|
|
}
|
|
|
}
|
|
|
+ // 校验是否禁用
|
|
|
+ if (ObjectUtil.notEqual(user.getStatus(), MendunerStatusEnum.ENABLE.getStatus())) {
|
|
|
+ createLoginLog(user.getId(), email, logTypeEnum, LoginResultEnum.USER_DISABLED);
|
|
|
+ throw exception(MDE_AUTH_LOGIN_USER_DISABLED);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
return user;
|
|
|
}
|