diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java index 75e3a7c..dd36c1c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java @@ -45,18 +45,26 @@ public class UserAuthLoginManage { * @return */ public UserFullInfoDTO queryUserInfoInPhoneNoAuth(String phoneNo) { - UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getMobile, phoneNo)); - if (Objects.isNull(userInfo)) { - return null; - } +// UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) +// .eq(UserInfo::getMobile, phoneNo)); +// if (Objects.isNull(userInfo)) { +// return null; +// } +// +// UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); +// userFullInfoDTO.setCompanyId(1L); +// userFullInfoDTO.setUserId(userInfo.getId()); +// userFullInfoDTO.setIdentifier(userInfo.getRealName()); +// userFullInfoDTO.setRealName(userInfo.getRealName()); +// userFullInfoDTO.setUsername(userInfo.getRealName()); +// return userFullInfoDTO; UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); userFullInfoDTO.setCompanyId(1L); - userFullInfoDTO.setUserId(userInfo.getId()); - userFullInfoDTO.setIdentifier(userInfo.getRealName()); - userFullInfoDTO.setRealName(userInfo.getRealName()); - userFullInfoDTO.setUsername(userInfo.getRealName()); + userFullInfoDTO.setUserId(1L); + userFullInfoDTO.setIdentifier("123456"); + userFullInfoDTO.setRealName("测试账号"); + userFullInfoDTO.setUsername("测试账号"); return userFullInfoDTO; } @@ -67,17 +75,25 @@ public class UserAuthLoginManage { * @return */ public UserFullInfoDTO queryUserInfoInAccountIdAuth(String accountId) { - UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getAccountId, accountId)); - if (Objects.isNull(userInfo)) { - return null; - } +// UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) +// .eq(UserInfo::getAccountId, accountId)); +// if (Objects.isNull(userInfo)) { +// return null; +// } +// UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); +// userFullInfoDTO.setCompanyId(1L); +// userFullInfoDTO.setUserId(userInfo.getId()); +// userFullInfoDTO.setIdentifier(userInfo.getRealName()); +// userFullInfoDTO.setRealName(userInfo.getRealName()); +// userFullInfoDTO.setUsername(userInfo.getRealName()); +// return userFullInfoDTO; + UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); userFullInfoDTO.setCompanyId(1L); - userFullInfoDTO.setUserId(userInfo.getId()); - userFullInfoDTO.setIdentifier(userInfo.getRealName()); - userFullInfoDTO.setRealName(userInfo.getRealName()); - userFullInfoDTO.setUsername(userInfo.getRealName()); + userFullInfoDTO.setUserId(1L); + userFullInfoDTO.setIdentifier("123456"); + userFullInfoDTO.setRealName("测试账号"); + userFullInfoDTO.setUsername("测试账号"); return userFullInfoDTO; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java index 27bbb2a..1261c8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/credential/CredentialAuthProvider.java @@ -58,12 +58,14 @@ public class CredentialAuthProvider implements AuthenticationProvider { } break; case USERNAME_PASSWORD_LOGIN: { - user = userDetailsService.loadUserByUsername((String) authenticationToken.getPrincipal()); - if (user == null) { - throw new InternalAuthenticationServiceException("can not get user info!"); - } - // 账号密码登陆 更改 - additionalAuthenticationChecks(user, authenticationToken); + user = userDetailsService.loadUserByUsername(principal + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name()); + // TODO 校验测试环境关闭登陆校验 + + // if (user == null) { +// throw new InternalAuthenticationServiceException("can not get user info!"); +// } +// // 账号密码登陆 更改 +// additionalAuthenticationChecks(user, authenticationToken); } break; }