|
|
@ -12,7 +12,7 @@ import org.springframework.security.core.GrantedAuthority; |
|
|
|
import org.springframework.security.core.authority.AuthorityUtils; |
|
|
|
import org.springframework.security.core.authority.AuthorityUtils; |
|
|
|
import org.springframework.security.core.userdetails.UserDetails; |
|
|
|
import org.springframework.security.core.userdetails.UserDetails; |
|
|
|
import org.springframework.security.core.userdetails.UserDetailsService; |
|
|
|
import org.springframework.security.core.userdetails.UserDetailsService; |
|
|
|
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; |
|
|
|
import org.springframework.security.core.userdetails.UsernameNotFoundException; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collection; |
|
|
@ -54,7 +54,7 @@ public interface KiccUserDetailsService extends UserDetailsService, Ordered { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
default UserDetails getUserDetails(R<User> result) { |
|
|
|
default UserDetails getUserDetails(R<User> result) { |
|
|
|
if (result == null || result.getData() == null) { |
|
|
|
if (result == null || result.getData() == null) { |
|
|
|
throw new OAuth2Exception(result.getMsg()); |
|
|
|
throw new UsernameNotFoundException("用户不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
User user = result.getData(); |
|
|
|
User user = result.getData(); |
|
|
|