bug
This commit is contained in:
@@ -166,8 +166,15 @@ public class MyUserController {
|
||||
* 常规注册 发短信验证码
|
||||
*/
|
||||
@RequestMapping("/sms/sendcode")
|
||||
public R registerSms(@RequestParam("phone") String phone,@RequestParam Integer areaCode) throws Exception {
|
||||
public R registerSms(@RequestParam("phone") String phone,@RequestParam(required = false) String areaCode) throws Exception {
|
||||
int areacode=0;
|
||||
if(areaCode==null||areaCode.equals("")){
|
||||
areacode=0;
|
||||
}else{
|
||||
areacode = Integer.valueOf(areaCode);
|
||||
}
|
||||
|
||||
System.out.println(areacode);
|
||||
//验证一分钟内是否已经发过
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
if (!StringUtils.isEmpty(redisCode)) {
|
||||
@@ -192,7 +199,7 @@ public class MyUserController {
|
||||
redisTemplate.opsForValue().set("RegistCode"+phone,code,5, TimeUnit.MINUTES);
|
||||
|
||||
//发送
|
||||
userService.sendCodeForRegister(phone,code,areaCode);
|
||||
userService.sendCodeForRegister(phone,code,areacode);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user