|
@ -537,10 +537,10 @@ public class SysService {
|
537
|
537
|
@Post
|
538
|
538
|
@Path("/login")
|
539
|
539
|
public SessionUser login(@JdbcConn Connection con, String lk, String pw)
|
540
|
|
throws SQLException {
|
|
540
|
throws SQLException,JfwBaseException {
|
541
|
541
|
User user = userDao.queryByEmailOrMobilePhone(con, lk);
|
542
|
542
|
if (null == user)
|
543
|
|
throw new SQLException("该用户还未注册");
|
|
543
|
throw new JfwBaseException(-1,"该用户还未注册");
|
544
|
544
|
if (DEFAULT_PASS_WORD.equals(user.getPasswd()))
|
545
|
545
|
return null;
|
546
|
546
|
if (!StringUtil.md5(pw).equals(user.getPasswd()))
|
|
@ -548,8 +548,9 @@ public class SysService {
|
548
|
548
|
|
549
|
549
|
SessionUser ret = new SessionUser();
|
550
|
550
|
ret.setId(user.getId());
|
551
|
|
if (null != this.professorDao.query(con, user.getId())) {
|
552
|
|
ret.setName(this.professorDao.query(con, user.getId()).getName());
|
|
551
|
Professor pf = this.professorDao.query(con, user.getId());
|
|
552
|
if (null !=pf) {
|
|
553
|
ret.setName(pf.getName());
|
553
|
554
|
}
|
554
|
555
|
ret.setMobilePhone(user.getMobilePhone());
|
555
|
556
|
ret.setType(user.getUserType());
|