| | |
| | | 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;
|
| | | }
|
| | | }
|