增加腾讯云短信
This commit is contained in:
@@ -95,11 +95,14 @@ public class LoginController {
|
||||
return new ResponseEntity<>("code is not same", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
try {
|
||||
User user = userService.registerByPhone(phone, code, deviceId,new Date());
|
||||
User user = userService.registerByPhone(phone, code, deviceId, new Date());
|
||||
TokenPair tokenPair = jwtUtil.generateTokenPair(user.getUserId(), deviceId);
|
||||
//返回给app保存,access_token用来加入header请求接口,refresh_token用来更换access_token
|
||||
return new ResponseEntity<>(tokenPair, HttpStatus.CREATED);
|
||||
} catch (RuntimeException e) {
|
||||
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
|
||||
} finally {
|
||||
redisTemplate.delete(phone);
|
||||
}
|
||||
} else {
|
||||
return new ResponseEntity<>("verify key is expired", HttpStatus.BAD_REQUEST);
|
||||
|
||||
Reference in New Issue
Block a user