update m2pool 新增注销账号功能
This commit is contained in:
@@ -99,12 +99,11 @@ public class TokenController {
|
||||
|
||||
|
||||
/**
|
||||
* 关闭注销账户
|
||||
* 注销账户
|
||||
* @param closeAccountVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/closeAccount")
|
||||
@RequiresLogin
|
||||
@ApiOperation(value = "用户注销")
|
||||
public R<?> closeAccount(@RequestBody @Valid CloseAccountVo closeAccountVo){
|
||||
return sysLoginService.closeAccount(closeAccountVo);
|
||||
|
||||
@@ -578,6 +578,7 @@ public class SysLoginService {
|
||||
throw new ServiceException("邮箱为必填项");
|
||||
}
|
||||
String closeAccountKey = RedisTransKey.getCloseAccountKey(email);
|
||||
System.out.println("redis 的 key"+closeAccountKey);
|
||||
//校验谷歌验证码和邮箱验证码
|
||||
if(redisService.hasKey(closeAccountKey)){
|
||||
Object o = redisService.getCacheObject(closeAccountKey);//user:emailCode:email
|
||||
@@ -591,8 +592,8 @@ public class SysLoginService {
|
||||
}else {
|
||||
throw new ServiceException("验证码未获取或已过期,请重新获取验证码");
|
||||
}
|
||||
R<Boolean> booleanR1 = remoteUserService.checkGoogleCode(closeAccountVo.getGCode(), SecurityConstants.INNER);
|
||||
if(!booleanR1.getData()){
|
||||
R<Boolean> booleanR1 = remoteUserService.checkGoogleCode(closeAccountVo, SecurityConstants.INNER);
|
||||
if((booleanR1 != null && booleanR1.getData() == null) || !booleanR1.getData()){
|
||||
throw new ServiceException("谷歌验证码错误");
|
||||
}
|
||||
|
||||
|
||||
@@ -572,6 +572,7 @@ public class MaliServiceImpl implements MailService {
|
||||
|
||||
//判断用户是不是恶意刷邮箱,在规定时间内进行的
|
||||
String closeAccountKey = RedisTransKey.getCloseAccountKey(email);
|
||||
System.out.println("redis 的 key"+closeAccountKey);
|
||||
if (redisService.hasKey(closeAccountKey)) {
|
||||
|
||||
Object o = redisService.getCacheObject(closeAccountKey);//user:updatePwdCode:email
|
||||
@@ -602,7 +603,7 @@ public class MaliServiceImpl implements MailService {
|
||||
);
|
||||
sendCloseAccountMailMessage(email, emailCodeEntity.getEmailCode());
|
||||
}
|
||||
return R.success("请求成功,修改密码验证码已经发送至用户邮箱");
|
||||
return R.success("请求成功,注销账户邮箱验证码发送成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user