增加微信用户绑定账号时发送验证码
This commit is contained in:
parent
36488017f6
commit
1073ab28d9
@ -119,7 +119,7 @@ public class WxAuthController {
|
||||
int infoSign = sysSignInService.updateSysSignIn(sysSignInWx);
|
||||
|
||||
if (infoSign == 0) {
|
||||
return AjaxResult.error("绑定失败");
|
||||
return AjaxResult.error("绑定失败, 请联系管理员");
|
||||
}
|
||||
return AjaxResult.success("绑定成功");
|
||||
|
||||
|
||||
@ -211,6 +211,22 @@ public class ApiController extends BaseController {
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 绑定微信用户时的发送验证码
|
||||
@PostMapping("/sendBindSmsCode")
|
||||
public AjaxResult sendBindSmsCode(@RequestBody XmLoginDto xmLoginDto) throws Exception {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// // 验证码校验 但是不删除校验码
|
||||
// loginService.validateCaptchaOne(xmLoginDto.getPhone(), xmLoginDto.getImgCode(), xmLoginDto.getUuid());
|
||||
//上面已经验证成功了
|
||||
Random random = new Random();
|
||||
String smsCode = String.valueOf(100000 + random.nextInt(900000));
|
||||
SendSms.sendSmsCode(xmLoginDto.getPhone(), smsCode);
|
||||
System.out.println("验证码是"+smsCode);
|
||||
// 将短信验证码存入redis
|
||||
redisCache.setCacheObject("SMSCODE:" + xmLoginDto.getPhone(), smsCode, 1, TimeUnit.HOURS);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/masterList")
|
||||
public AjaxResult getMasterList() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user