ssh登陸時根據用戶名判斷是否存在

public Companyuser getCompanyuserByName(String userName) {
  List list = userDao.findByUserName(userName);
  if (list.size() > 0)
   return (Companyuser) list.get(0);
  return null;
 }java

// 登錄方法
 /*
  * (非 Javadoc)
  *
  * @see biz.ICompanyuserBiz#login(java.lang.String, java.lang.String)
  */
 public dao.Companyuser login(String userName, String passWord) {
  util.MD5 md5 = new MD5();
  passWord = md5.getMD5ofStr(passWord);
  Companyuser companyuser = this.getCompanyuserByName(userName);
  if (companyuser == null || !companyuser.getPassWord().equals(passWord)) {
   companyuser = null;
  }
  return companyuser;
 }

 ide

相關文章
相關標籤/搜索