1、忘记密码,去掉原始密码校验

beetlsql3-dev
wgf 2 years ago
parent ff22e594af
commit 454c5e6251

@ -176,6 +176,18 @@ public class CoreUserService extends CoreBaseService<CoreUser> {
return coreUserDao.updateTemplateById(entity) > 0;
}
/**
* -
* @return
*/
public Boolean editPwdByOldNotVerify(@NotBlank(message = "新密码不能为空!") String newPwd,
@NotNull(message = "用户ID不能为空") Long userId) {
CoreUser entity = new CoreUser();
entity.setId(userId);
entity.setPassword(newPwd);
return coreUserDao.updateTemplateById(entity) > 0;
}
/**
* ID

@ -105,6 +105,13 @@ public interface StudentDao extends BaseMapper<Student>{
*/
Student getStudentByStudentEditPasswordDTO(StudentEditPasswordDTO dto);
/**
* -
* @param dto
* @return
*/
Student getStudentByStudentEditPasswordNotVerifyDTO(StudentEditPasswordDTO dto);
StudentActiveInfo studentActiveInfo(Long studentId, Long userId);
}

@ -193,7 +193,7 @@ public class ApiStudentService {
// 密码遵循加密算法
dto.setNewPwd(passwordEncryptService.password(dto.getNewPwd()));
dto.setOldPwd(passwordEncryptService.password(dto.getOldPwd()));
// dto.setOldPwd(passwordEncryptService.password(dto.getOldPwd()));
// 传入的院校ID
final Long universitiesCollegesId = dto.getUniversitiesCollegesId();
@ -212,11 +212,15 @@ public class ApiStudentService {
Assert.isTrue(studentDao.templateCount(entity) > 0, "学生姓名不存在!");
}
Student studentInfo = studentDao.getStudentByStudentEditPasswordDTO(dto);
Assert.notNull(studentInfo, "原始密码错误!");
// Student studentInfo = studentDao.getStudentByStudentEditPasswordDTO(dto);
// Assert.notNull(studentInfo, "原始密码错误!");
Student studentInfo = studentDao.getStudentByStudentEditPasswordNotVerifyDTO(dto);
Assert.notNull(studentInfo, "未查询到学生");
// 根据旧密码修改新密码
Boolean updateSuccess = coreUserService.editPwdByOld(dto.getOldPwd(), dto.getNewPwd(), studentInfo.getUserId());
// Boolean updateSuccess = coreUserService.editPwdByOld(dto.getOldPwd(), dto.getNewPwd(), studentInfo.getUserId());
Boolean updateSuccess = coreUserService.editPwdByOldNotVerify( dto.getNewPwd(), studentInfo.getUserId());
Assert.isTrue(updateSuccess, "密码修改失败!");
}

@ -1478,6 +1478,22 @@ getStudentByStudentEditPasswordDTO
AND t.student_sn = #studentSn#
AND ta.PASSWORD = #oldPwd#
getStudentByStudentEditPasswordNotVerifyDTO
===
* 学生端-修改密码 验证信息
SELECT
t.*
FROM
student t
LEFT JOIN core_user ta ON ta.ID = t.user_id
WHERE
1 = 1
AND t.student_status = 1
AND ta.STATE = 'S1'
AND ta.DEL_FLAG = 0
AND t.student_name = #studentName#
AND t.student_sn = #studentSn#
studentActiveInfo
===

Loading…
Cancel
Save