xufenglei
2018-03-12 6a1b28591ebe95ed9f26810fbf9677da5c87692d
src/main/java/com/moral/service/impl/AccountServiceImpl.java
@@ -2,7 +2,6 @@
import static com.moral.common.bean.Constants.IS_DELETE_FALSE;
import static com.moral.common.bean.Constants.IS_DELETE_TRUE;
import static com.moral.common.util.Crypto.md5;
import static com.moral.common.util.ResourceUtil.getValue;
import static org.apache.commons.lang3.StringUtils.isNumeric;
import static org.springframework.util.ObjectUtils.isEmpty;
@@ -50,9 +49,11 @@
      Map<String, Object> result = new HashMap<String, Object>();
      Account account = new Account();
      account.setAccountName((String) parameters.get("account"));
      account.setPassword(md5((String) parameters.get("password")));
      String rawPassword = (String) parameters.get("password");
//      account.setPassword(encoder.encode((String) parameters.get("password")));
      account = accountMapper.selectOne(account);
      if (isEmpty(account)) {
      boolean isValid = account == null ? false:encoder.matches(rawPassword,account.getPassword());
      if (!isValid) {
         result.put("msg", "用户名及密码输入错误!");
      } else {
         if (IS_DELETE_FALSE.equals(account.getIsDelete())) {
@@ -171,9 +172,6 @@
   @Override
   public Optional<Account> queryAccountByName(String accountName) {
      Account account = accountMapper.getByAccountName(accountName);
      if(account!=null){
      }
      return Optional.ofNullable(account);
   }
}