|
@@ -40,9 +40,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
//权限字符
|
|
//权限字符
|
|
@Autowired
|
|
@Autowired
|
|
private ReRoleMenuMapper reRoleMenuMapper;
|
|
private ReRoleMenuMapper reRoleMenuMapper;
|
|
- /** 方法抽取 */
|
|
|
|
- @Autowired
|
|
|
|
- private MethodAppUserService methodAppUserService;
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -58,6 +56,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
|
|
|
|
/** 改 */
|
|
/** 改 */
|
|
void update(AppUser a){
|
|
void update(AppUser a){
|
|
|
|
+ a.setUpdateTime(new Date());
|
|
updateById(a);
|
|
updateById(a);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -187,8 +186,8 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
//获取当前手机号对象
|
|
//获取当前手机号对象
|
|
AppUser appUser = appUserList.get(0);
|
|
AppUser appUser = appUserList.get(0);
|
|
//获取短信验证码发送结果
|
|
//获取短信验证码发送结果
|
|
- boolean sendResult = methodAppUserService.getSmsCode(forgetPasswordDto.getPhone());
|
|
|
|
- if(!sendResult)return AjaxJson.getError("验证码发送失败!");
|
|
|
|
|
|
+ boolean phoneSmsCode = getPhoneSmsCode(forgetPasswordDto.getPhone());
|
|
|
|
+ if(!phoneSmsCode)return AjaxJson.getError("验证码发送失败!");
|
|
//从缓存中获取验证码
|
|
//从缓存中获取验证码
|
|
String smsCode = RedisUtil.get(forgetPasswordDto.getPhone());
|
|
String smsCode = RedisUtil.get(forgetPasswordDto.getPhone());
|
|
if(smsCode == null)return AjaxJson.getError("验证码发送失败!");
|
|
if(smsCode == null)return AjaxJson.getError("验证码发送失败!");
|
|
@@ -218,4 +217,17 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
return AjaxJson.getError("验证码输入错误,请检查!");
|
|
return AjaxJson.getError("验证码输入错误,请检查!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 获取验证码 */
|
|
|
|
+ boolean getPhoneSmsCode(String phone){
|
|
|
|
+ //todo: 发送短信,其短信商回调验证码
|
|
|
|
+ String smsCode = "123";
|
|
|
|
+ //todo: 根据其短信发送情况返回不同的结果
|
|
|
|
+
|
|
|
|
+ // return false;
|
|
|
|
+
|
|
|
|
+ //todo: 保存到缓存,默认1分钟
|
|
|
|
+ RedisUtil.setByMINUTES(phone,smsCode, 1);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|