From 24deed45e6c19eb71d73a86e9a9f5194cda91dab Mon Sep 17 00:00:00 2001 From: Lierbao Date: Wed, 4 Jan 2023 17:13:18 +0800 Subject: [PATCH] userInfo userAuth --- .../pmapi/user/security/auth/model/UserFullInfoDTO.java | 16 ++++++++++++++++ .../pmapi/user/security/auth/model/UserInfoDetails.java | 6 ------ .../auth/password/PasswordLoginUserDetailService.java | 17 ++++++++--------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java index 34e73f3..f558f9c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java @@ -9,4 +9,20 @@ import lombok.Data; @Data public class UserFullInfoDTO { + + private Long userId; + + private String realName; + + private String username; + + private String identifier; + + private String credential; + + private String role; + + private Long regionCode; + + private Long companyId; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index b497f95..a10e2c1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -9,7 +9,6 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; -import java.util.List; /** * @author LiuXinXin @@ -33,11 +32,6 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { private Long companyId; /** - * 所负责公司id列表 - */ - private List responsibleCompanyIdList; - - /** * 获取用户权限 * * @return diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java index 4c77e9b..4c55fde 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java @@ -29,15 +29,14 @@ public class PasswordLoginUserDetailService implements UserDetailsService { throw new UsernameNotFoundException(String.format("%s user not exist", username)); } UserInfoDetails userInfoDetails = new UserInfoDetails(); -// userInfoDetails.setUserId(userFullInfoDTO.getUserId()); -// userInfoDetails.setUsername(userFullInfoDTO.getUsername()); -// userInfoDetails.setRealName(userFullInfoDTO.getRealName()); -// userInfoDetails.setRole(userFullInfoDTO.getRole()); -// userInfoDetails.setRegionCode(userFullInfoDTO.getRegionCode()); -// userInfoDetails.setCompanyId(userFullInfoDTO.getCompanyId()); -// userInfoDetails.setResponsibleCompanyIdList(userFullInfoDTO.getResponsibleCompanyIdList()); -// userInfoDetails.setIdentifier(userFullInfoDTO.getIdentifier()); -// userInfoDetails.setPassword(userFullInfoDTO.getCredential()); + userInfoDetails.setUserId(userFullInfoDTO.getUserId()); + userInfoDetails.setUsername(userFullInfoDTO.getUsername()); + userInfoDetails.setRealName(userFullInfoDTO.getRealName()); + userInfoDetails.setRole(userFullInfoDTO.getRole()); + userInfoDetails.setRegionCode(userFullInfoDTO.getRegionCode()); + userInfoDetails.setCompanyId(userFullInfoDTO.getCompanyId()); + userInfoDetails.setIdentifier(userFullInfoDTO.getIdentifier()); + userInfoDetails.setPassword(userFullInfoDTO.getCredential()); return userInfoDetails; } }