|
@@ -42,19 +42,15 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
protected UserDetails retrieveUser(String username, Authentication authentication) throws AuthenticationException {
|
|
|
-
|
|
|
LoginEntity loginEntity = (LoginEntity) authentication.getCredentials();
|
|
|
if (loginEntity == null) {
|
|
|
throw new BadCredentialsException("Bad credentials");
|
|
|
}
|
|
|
-
|
|
|
String smsCode = loginEntity.getSmsCode();
|
|
|
-
|
|
|
String phone = loginEntity.getPhone();
|
|
|
|
|
|
// 验证码验证
|
|
|
- boolean b = smsCodeService.verifyValidCode(phone, smsCode);
|
|
|
- if (!b) {
|
|
|
+ if (!smsCodeService.verifyValidCode(phone, smsCode)) {
|
|
|
throw new BadCredentialsException("验证码校验失败");
|
|
|
}
|
|
|
|