From 48bfa4e57cd2195b86bd8c0debe2e241db0ba80d Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Mon, 05 Feb 2018 14:49:44 +0800 Subject: [PATCH] 报表 --- src/main/java/com/moral/service/impl/AccountServiceImpl.java | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/moral/service/impl/AccountServiceImpl.java b/src/main/java/com/moral/service/impl/AccountServiceImpl.java index be7b39a..a0e4000 100644 --- a/src/main/java/com/moral/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/moral/service/impl/AccountServiceImpl.java @@ -7,15 +7,11 @@ import static org.apache.commons.lang3.StringUtils.isNumeric; import static org.springframework.util.ObjectUtils.isEmpty; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import javax.annotation.Resource; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; @@ -38,7 +34,8 @@ @Service public class AccountServiceImpl implements AccountService { - + @Resource + private BCryptPasswordEncoder encoder; @Resource private AccountMapper accountMapper; @@ -47,7 +44,7 @@ @Resource private OrganizationMapper organizationMapper; - + @Override public Map<String, Object> screenLogin(Map<String, Object> parameters) { Map<String, Object> result = new HashMap<String, Object>(); @@ -147,7 +144,7 @@ if (ObjectUtils.isEmpty(account.getId())) { account.setIsDelete(Constants.IS_DELETE_FALSE); account.setCreateTime(new Date()); - account.setPassword(Crypto.md5(ResourceUtil.getValue("password"))); + account.setPassword(encoder.encode(ResourceUtil.getValue("password"))); return accountMapper.insertSelective(account); } else { return accountMapper.updateByPrimaryKeySelective(account); @@ -171,4 +168,12 @@ return accountMapper.selectCount(account); } + @Override + public Optional<Account> queryAccountByName(String accountName) { + Account account = accountMapper.getByAccountName(accountName); + if(account!=null){ + + } + return Optional.ofNullable(account); + } } -- Gitblit v1.8.0