|
|
@@ -2,8 +2,10 @@ package com.ningdatech.pmapi.user.security.auth.agent; |
|
|
|
|
|
|
|
|
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.validate.CommonLoginException; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.security.core.userdetails.UserDetailsService; |
|
|
|
import org.springframework.security.core.userdetails.UsernameNotFoundException; |
|
|
@@ -32,6 +34,10 @@ public class AgentLoginUserDetailService implements UserDetailsService { |
|
|
|
if (Objects.isNull(userFullInfoDTO)) { |
|
|
|
throw new UsernameNotFoundException(String.format("%s user not exist", username)); |
|
|
|
} |
|
|
|
if (UserAvailableEnum.DISABLE.equals(userFullInfoDTO.getAvailable())) { |
|
|
|
throw new CommonLoginException("该账号已被禁用"); |
|
|
|
} |
|
|
|
|
|
|
|
UserInfoDetails userInfoDetails = new UserInfoDetails(); |
|
|
|
userInfoDetails.setUserId(userFullInfoDTO.getUserId()); |
|
|
|
userInfoDetails.setUsername(userFullInfoDTO.getUsername()); |
|
|
|