短信功能完善

This commit is contained in:
liang.chao 2024-08-13 10:27:54 +08:00
parent c0fd7885dc
commit ce2396aafc
1 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
}
// 校验是否存在该手机号
SysUser sysUser = sysUserMapper.checkPhoneUnique(phone);
if (sysUser == null){
if (sysUser == null) {
return AjaxResult.error("该手机号未绑定用户,请重新确认");
}
String code = getSixBitCode();
@ -165,7 +165,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
// 存储验证码至Redis中键值为code_15588886157 , 有效期5时间颗粒度为MINUTES:分钟
redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES);
// return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body);
return success("验证码发送成功",body);
return success("验证码发送成功:" + body);
} catch (Exception e) {
return AjaxResult.error("发送失败:" + e.getMessage());
}