|
@@ -116,8 +116,9 @@ public class UserDaoHibernate extends GenericDaoHibernate<User, Long> implements
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- throw new UsernameNotFoundException("user '" + username
|
|
|
|
- + "' not found...");
|
|
|
|
|
|
+// throw new UsernameNotFoundException("user '" + username
|
|
|
|
+// + "' not found...");
|
|
|
|
+ log.info("loadUserByUsername进来了这里");
|
|
}
|
|
}
|
|
String strHql = "from User where (username=? or telephone=?) and isenabled=1";
|
|
String strHql = "from User where (username=? or telephone=?) and isenabled=1";
|
|
List<User> users = getSession().createQuery(strHql).setString(0, username).setString(1, username).list();
|
|
List<User> users = getSession().createQuery(strHql).setString(0, username).setString(1, username).list();
|
|
@@ -132,7 +133,7 @@ public class UserDaoHibernate extends GenericDaoHibernate<User, Long> implements
|
|
log.info("ecodeStr:{}",ecodeStr);
|
|
log.info("ecodeStr:{}",ecodeStr);
|
|
((User) details).setPassword(ecodeStr);
|
|
((User) details).setPassword(ecodeStr);
|
|
}
|
|
}
|
|
- log.info("details:{}", JsonUtils.toJson(details));
|
|
|
|
|
|
+ log.info("details2:{}", JsonUtils.toJson(details));
|
|
return details;
|
|
return details;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -161,8 +162,8 @@ public class UserDaoHibernate extends GenericDaoHibernate<User, Long> implements
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public User getUserByUsername2(String username) {
|
|
public User getUserByUsername2(String username) {
|
|
- String strHql = "from User where username=? and isenabled=1";
|
|
|
|
- List<User> users = getSession().createQuery(strHql).setString(0, username).list();
|
|
|
|
|
|
+ String strHql = "from User where (username=? or telephone=?) and isenabled=1";
|
|
|
|
+ List<User> users = getSession().createQuery(strHql).setString(0, username).setString(1,username).list();
|
|
if (users == null || users.isEmpty()) {
|
|
if (users == null || users.isEmpty()) {
|
|
return null;
|
|
return null;
|
|
} else {
|
|
} else {
|