From a6ea3af4f8e917f1c19204bbaa5a75a4a86716ac Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Mon, 16 Jul 2018 14:57:38 +0800 Subject: [PATCH] 组织登录后 返回行政区信息 "中国/江苏省/苏州市/昆山市" --- src/main/java/com/moral/service/impl/AccountServiceImpl.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/moral/service/impl/AccountServiceImpl.java b/src/main/java/com/moral/service/impl/AccountServiceImpl.java index 1fbcfa1..cf1ef0c 100644 --- a/src/main/java/com/moral/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/moral/service/impl/AccountServiceImpl.java @@ -22,6 +22,7 @@ import com.moral.common.exception.BusinessException; import com.moral.common.util.Crypto; import com.moral.common.util.ResourceUtil; +import com.moral.common.util.ValidateUtil; import com.moral.entity.Account; import com.moral.entity.Organization; import com.moral.mapper.AccountMapper; @@ -179,4 +180,22 @@ Account account = accountMapper.getByAccountName(accountName); return Optional.ofNullable(account); } + + @Override + public Account companyLogin(Map<String, Object> parameters) { + ValidateUtil.notNull(parameters.get("account"), "param.is.null"); + ValidateUtil.notNull(parameters.get("password"), "param.is.null"); + 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; + } } -- Gitblit v1.8.0