glj-代码提交
This commit is contained in:
parent
e48045eb2b
commit
81fdda8f21
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue