mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
✨ Introducing new features. 手机号登录
This commit is contained in:
parent
89ef0003fc
commit
3bc9d64a05
@ -62,7 +62,6 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
||||
*/
|
||||
private PhoneAuthenticationProvider phoneAuthenticationProvider() {
|
||||
PhoneAuthenticationProvider phoneAuthenticationProvider = new PhoneAuthenticationProvider();
|
||||
phoneAuthenticationProvider.setPasswordEncoder(passwordEncoder());
|
||||
phoneAuthenticationProvider.setUserDetailsService(userDetailsService);
|
||||
return phoneAuthenticationProvider;
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pig.common.security.service.PigUserDetailsServiceImpl;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
|
||||
@ -13,7 +12,6 @@ import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
/**
|
||||
* @author hzq
|
||||
@ -25,9 +23,6 @@ public class PhoneAuthenticationProvider extends AbstractUserDetailsAuthenticati
|
||||
@Setter
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
@Setter
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 校验 请求信息userDetails
|
||||
* @param userDetails 用户信息
|
||||
@ -51,7 +46,7 @@ public class PhoneAuthenticationProvider extends AbstractUserDetailsAuthenticati
|
||||
|
||||
if (authentication.getCredentials() == null) {
|
||||
log.debug("Failed to authenticate since no credentials provided");
|
||||
throw new BeanCreationException("Bad credentials");
|
||||
throw new BadCredentialsException("Bad credentials");
|
||||
}
|
||||
|
||||
// 手机号
|
||||
|
Loading…
Reference in New Issue
Block a user