| | |
| | | if (StrUtil.isNotBlank(username) && userService.findByUsername(username) != null) { |
| | | throw new XbootException("该登录账号已被注册"); |
| | | } |
| | | if (StrUtil.isNotBlank(email) && userService.findByEmail(email) != null) { |
| | | throw new XbootException("该邮箱已被注册"); |
| | | } |
| | | // if (StrUtil.isNotBlank(email) && userService.findByEmail(email) != null) { |
| | | // throw new XbootException("该邮箱已被注册"); |
| | | // } |
| | | if (StrUtil.isNotBlank(mobile) && userService.findByMobile(mobile) != null) { |
| | | throw new XbootException("该手机号已被注册"); |
| | | } |
| | |
| | | |
| | | List<User> list = userService.findByType2(type); |
| | | // 清除持久上下文环境 避免后面语句导致持久化 |
| | | List<User> list1 = new ArrayList<User>(); |
| | | entityManager.clear(); |
| | | for (User u : list) { |
| | | u.setPassword(null); |
| | | if (u.getType()==0){ |
| | | list1.add(u); |
| | | } |
| | | } |
| | | return new ResultUtil<List<User>>().setData(list); |
| | | return new ResultUtil<List<User>>().setData(list1); |
| | | } |
| | | } |