Skip to content

Commit

Permalink
修复使用超级验证码修改密码时,可能提示验证码过期问题
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Jul 19, 2023
1 parent 8703b64 commit be4dda1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/cn/wildfirechat/app/ServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,10 @@ public RestResult resetPassword(String mobile, String resetCode, String newPwd)
Optional<UserPassword> optional = userPasswordRepository.findById(userId);
if (optional.isPresent()) {
UserPassword up = optional.get();
if (resetCode.equals(up.getResetCode()) && System.currentTimeMillis() - up.getResetCodeTime() > 10 * 60 * 60 * 1000){
return RestResult.error(ERROR_CODE_EXPIRED);
}
if(resetCode.equals(up.getResetCode()) || (!StringUtils.isEmpty(superCode) && resetCode.equals(superCode))) {
if (System.currentTimeMillis() - up.getResetCodeTime() > 10 * 60 * 60 * 1000) {
return RestResult.error(ERROR_CODE_EXPIRED);
}
try {
changePassword(up, newPwd);
up.setResetCode(null);
Expand Down

0 comments on commit be4dda1

Please sign in to comment.