xufenglei
2018-06-29 e45bad6cf75f6da4e8002020755cc07a55892e14
src/main/java/com/moral/service/impl/AccountServiceImpl.java
@@ -179,4 +179,20 @@
      Account account = accountMapper.getByAccountName(accountName);
      return Optional.ofNullable(account);
   }
   @Override
   public Account companyLogin(Map<String, Object> parameters) {
      Account account = new Account();
      account.setIsDelete(Constants.IS_DELETE_FALSE);
      account.setAccountName(parameters.get("account").toString());
      account = accountMapper.selectOne(account);
      if (ObjectUtils.isEmpty(account)) {
         throw new BusinessException("账户不存在,请联系管理员!");
      }
      if (!encoder.matches(parameters.get("password").toString(), account.getPassword())) {
         throw new BusinessException("密码错误,请重新输入!");
      }
      account.setPassword(parameters.get("password").toString());
      return account;
   }
}