update 管理端 发送验证码判断用户名和手机号

企业端发送验证码判断重置密码和登录两种类型
This commit is contained in:
lijiarao
2021-10-13 10:46:26 +08:00
parent 64ead9487e
commit a8f5ffa5f3
2 changed files with 8 additions and 5 deletions
@@ -602,14 +602,16 @@ public class LoginController {
@ApiOperation(value = "发送手机号验证码")
@GetMapping(value = "/sendVerificationCode")
public Result<?> sendVerificationCode(String phone) {
public Result<?> sendVerificationCode(@RequestParam(name="phone") String phone,
@RequestParam(name="userName") String userName) {
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysUser::getPhone, PasswordUtil.encrypt(phone));
queryWrapper.eq(SysUser::getUsername, userName);
SysUser sysUser = sysUserService.getOne(queryWrapper);
if (Objects.isNull(sysUser)){
throw new JeroBootException("手机号不存在");
throw new JeroBootException("手机号或用户名不存在");
}
sysBaseAPI.sendVerificationCode(phone,"2",null,null);
sysBaseAPI.sendVerificationCode(phone,"2","300",null);
String string = redisUtil.get("_verification:_phone:" + phone).toString();
return Result.OK(string);
}