fix 发送手机验证码没有解密手机号

This commit is contained in:
lijiarao
2021-09-28 11:49:06 +08:00
parent 0d797622d1
commit 79b0b141be
2 changed files with 4 additions and 6 deletions
@@ -258,15 +258,14 @@ public class CompanyLoginController {
@ApiOperation(value = "发送手机号验证码") @ApiOperation(value = "发送手机号验证码")
@GetMapping(value = "/sendVerificationCode") @GetMapping(value = "/sendVerificationCode")
public Result<?> sendVerificationCode(String phone) { public Result<?> sendVerificationCode(String phone) {
phone = PasswordUtil.encrypt(phone);
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PayContactsManagement::getPhone, phone); queryWrapper.eq(PayContactsManagement::getPhone, PasswordUtil.encrypt(phone));
PayContactsManagement contactsManagement = payContactsManagementService.getOne(queryWrapper); PayContactsManagement contactsManagement = payContactsManagementService.getOne(queryWrapper);
if (Objects.isNull(contactsManagement)){ if (Objects.isNull(contactsManagement)){
throw new JeroBootException("手机号不是企业联系人"); throw new JeroBootException("手机号不是企业联系人");
} }
sysBaseAPI.sendVerificationCode(phone,"2",null,null); sysBaseAPI.sendVerificationCode(phone,"2",null,null);
String string = redisUtil.get("_verification:_phone:" + PasswordUtil.decrypt(phone)).toString(); String string = redisUtil.get("_verification:_phone:" + phone).toString();
return Result.OK(string); return Result.OK(string);
} }
@@ -603,15 +603,14 @@ public class LoginController {
@ApiOperation(value = "发送手机号验证码") @ApiOperation(value = "发送手机号验证码")
@GetMapping(value = "/sendVerificationCode") @GetMapping(value = "/sendVerificationCode")
public Result<?> sendVerificationCode(String phone) { public Result<?> sendVerificationCode(String phone) {
phone = PasswordUtil.encrypt(phone);
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysUser::getPhone, phone); queryWrapper.eq(SysUser::getPhone, PasswordUtil.encrypt(phone));
SysUser sysUser = sysUserService.getOne(queryWrapper); SysUser sysUser = sysUserService.getOne(queryWrapper);
if (Objects.isNull(sysUser)){ if (Objects.isNull(sysUser)){
throw new JeroBootException("手机号不存在"); throw new JeroBootException("手机号不存在");
} }
sysBaseAPI.sendVerificationCode(phone,"2",null,null); sysBaseAPI.sendVerificationCode(phone,"2",null,null);
String string = redisUtil.get("_verification:_phone:" + PasswordUtil.decrypt(phone)).toString(); String string = redisUtil.get("_verification:_phone:" + phone).toString();
return Result.OK(string); return Result.OK(string);
} }
} }