|
|
@ -7,6 +7,7 @@ import com.cloud.kicc.common.core.constant.CommonConstants; |
|
|
|
import com.cloud.kicc.common.core.constant.SecurityConstants; |
|
|
|
import com.cloud.kicc.common.core.constant.SecurityConstants; |
|
|
|
import com.cloud.kicc.common.core.exception.CheckedException; |
|
|
|
import com.cloud.kicc.common.core.exception.CheckedException; |
|
|
|
import com.cloud.kicc.common.data.entity.KiccUser; |
|
|
|
import com.cloud.kicc.common.data.entity.KiccUser; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.security.exception.SecurityCheckedException; |
|
|
|
import com.cloud.kicc.system.api.entity.User; |
|
|
|
import com.cloud.kicc.system.api.entity.User; |
|
|
|
import org.springframework.core.Ordered; |
|
|
|
import org.springframework.core.Ordered; |
|
|
|
import org.springframework.security.core.GrantedAuthority; |
|
|
|
import org.springframework.security.core.GrantedAuthority; |
|
|
@ -54,6 +55,11 @@ public interface KiccUserDetailsService extends UserDetailsService, Ordered { |
|
|
|
* @return UserDetails |
|
|
|
* @return UserDetails |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
default UserDetails getUserDetails(R<User> result) { |
|
|
|
default UserDetails getUserDetails(R<User> result) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证请求是否成功
|
|
|
|
|
|
|
|
if (result.getCode() != R.SUCCESS) { |
|
|
|
|
|
|
|
throw new SecurityCheckedException(result.getMsg()); |
|
|
|
|
|
|
|
} |
|
|
|
User user = result.getData(); |
|
|
|
User user = result.getData(); |
|
|
|
Set<String> dbAuthsSet = new HashSet<>(); |
|
|
|
Set<String> dbAuthsSet = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
|
|