Example #1
0
  public String login() throws Exception {

    user = new User();
    user.setUsername(userInfo.getUsername());
    user.setPassword(userInfo.getPassword1());
    if (userService.login(user)) {
      session.put("username", user.getUsername());
      session.put("userId", userService.listOne(user.getUsername()).getId());
      return "loginSuccess";
    }
    return "loginFail";
  }
Example #2
0
 public String update() {
   user = userService.listOne((String) session.get("username"));
   user.setUsername(userInfo.getUsername());
   user.setAddress(userInfo.getAddress());
   user.setAnswer(userInfo.getAnswer());
   user.setEmail(userInfo.getEmail());
   user.setIdiograph(userInfo.getIdiograph());
   user.setIsOpen(userInfo.getIsopen());
   user.setPassword(userInfo.getPassword1());
   user.setQq(userInfo.getQq());
   user.setQuestion(userInfo.getQuestion());
   user.setRealname(userInfo.getRealname());
   user.setSex(userInfo.getSex());
   user.setBirthday(userInfo.getBirthday());
   userService.update(user);
   session.put("username", user.getUsername());
   return "update";
 }
Example #3
0
 public String register() throws Exception {
   user = new User();
   user.setUsername(userInfo.getUsername());
   user.setAddress(userInfo.getAddress());
   user.setAnswer(userInfo.getAnswer());
   user.setEmail(userInfo.getEmail());
   user.setIdiograph(userInfo.getIdiograph());
   user.setIsOpen(userInfo.getIsopen());
   user.setPassword(userInfo.getPassword1());
   user.setQq(userInfo.getQq());
   user.setQuestion(userInfo.getQuestion());
   user.setRealname(userInfo.getRealname());
   user.setSex(userInfo.getSex());
   user.setBirthday(userInfo.getBirthday());
   if (userService.exist(user)) {
     return "registerFail";
   } else {
     userService.add(user);
     return "registerSuccess";
   }
 }
Example #4
0
 public String info() {
   user = userService.getInfo(userInfo.getUserId());
   return "info";
 }
Example #5
0
 public String updateInput() {
   user = userService.listOne((String) session.get("username"));
   return "updateInput";
 }