Commit 06425c6971ea8a606433c615aac322b7cb5b6c3c
1 parent
09bf6aab
11
Showing
1 changed file
with
8 additions
and
3 deletions
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| ... | ... | @@ -113,7 +113,7 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 113 | 113 | @Override |
| 114 | 114 | public LoginVo login(LoginDto loginDto) { |
| 115 | 115 | LoginVo vo = new LoginVo(); |
| 116 | - | |
| 116 | + | |
| 117 | 117 | if(loginDto.getSignin() == 1){ |
| 118 | 118 | QueryWrapper<GarUser> qw = new QueryWrapper<>(); |
| 119 | 119 | GarUser nUser = null; |
| ... | ... | @@ -123,7 +123,7 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 123 | 123 | throw new UsernameNotFoundException("当前用户已存在!"); |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | - | |
| 126 | + | |
| 127 | 127 | vo.setLoginPhone(loginDto.getTel()); |
| 128 | 128 | if (Objects.isNull(loginDto)) { |
| 129 | 129 | throw new UsernameNotFoundException("当前用户不存在!"); |
| ... | ... | @@ -147,12 +147,14 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 147 | 147 | qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); |
| 148 | 148 | if(loginDto.getCode() == null && loginDto.getPassword() != null){ |
| 149 | 149 | qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); |
| 150 | - qw.lambda().eq(GarUser::getPassword, new BCryptPasswordEncoder().encode(loginDto.getPassword())); | |
| 151 | 150 | if(loginDto.getSignin() != 1){ |
| 152 | 151 | nUser = this.getOne(qw); |
| 153 | 152 | if (Objects.isNull(nUser)) { |
| 154 | 153 | throw new UsernameNotFoundException("当前用户不存在!"); |
| 155 | 154 | } |
| 155 | + if(!new BCryptPasswordEncoder().matches(loginDto.getPassword(),nUser.getPassword())){ | |
| 156 | + throw new UsernameNotFoundException("密码错误!"); | |
| 157 | + } | |
| 156 | 158 | } |
| 157 | 159 | }else{ |
| 158 | 160 | // 验证码验证 |
| ... | ... | @@ -176,6 +178,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 176 | 178 | |
| 177 | 179 | nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription()); |
| 178 | 180 | } |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 179 | 184 | //是否是投放点用户 |
| 180 | 185 | List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel()); |
| 181 | 186 | vo.setTestUser(CollectionUtil.isNotEmpty(list)); | ... | ... |