glj-代码提交

This commit is contained in:
管李杰 2024-07-22 14:51:53 +08:00
parent e48045eb2b
commit 81fdda8f21
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import com.kening.vordm.service.DisasterInfoService;
import com.kening.vordm.service.EmailService; import com.kening.vordm.service.EmailService;
import com.kening.vordm.vo.UserVo; import com.kening.vordm.vo.UserVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -24,6 +25,8 @@ public class LoginController {
//邮箱发送服务 //邮箱发送服务
private final EmailService emailService; private final EmailService emailService;
//引入BladeRedis
private BladeRedis bladeRedis;
/** /**
* 新增用户信息 * 新增用户信息
* *
@ -44,6 +47,7 @@ public class LoginController {
*/ */
@PostMapping("/sendUserPasswordEmail") @PostMapping("/sendUserPasswordEmail")
public R sendUserPasswordEmail(@RequestBody UserVo userVo) throws MessagingException { public R sendUserPasswordEmail(@RequestBody UserVo userVo) throws MessagingException {
bladeRedis.del("blade:user::user:account:595035-"+userVo.getEmail());
return emailService.sendUserPasswordEmail(userVo); return emailService.sendUserPasswordEmail(userVo);
} }

View File

@ -39,6 +39,7 @@ public class EmailServiceImpl implements EmailService {
private final DisasterInfoMapper disasterInfoMapper; private final DisasterInfoMapper disasterInfoMapper;
//引入BladeRedis
private final BladeRedis bladeRedis; private final BladeRedis bladeRedis;
@Value("${spring.mail.username}") @Value("${spring.mail.username}")
@ -67,8 +68,8 @@ public class EmailServiceImpl implements EmailService {
if (bladeUser == null || bladeUser.getPassword()==null){ if (bladeUser == null || bladeUser.getPassword()==null){
return R.data(1405, "There are currently no bound users for this email"); return R.data(1405, "There are currently no bound users for this email");
} }
disasterInfoMapper.updataUserByEmail(userVo.getEmail(),"1790ae2beb8e6c6a4c6744667e11c4ba26abeb09"); disasterInfoMapper.updataUserByEmail(userVo.getEmail(),"1790ae2beb8e6c6a4c6744667e11c4ba26abeb09");
bladeRedis.del("blade:user::user:account:595035-"+userVo.getEmail());
Email email = new Email(); Email email = new Email();
email.setSubject("Your login password has been updated"); email.setSubject("Your login password has been updated");
String encrypt = DigestUtil.encrypt(bladeUser.getPassword()); String encrypt = DigestUtil.encrypt(bladeUser.getPassword());