/**
  * 验证原始密码是否正确(Ajax调用)
  *
  * @return
  */
 @RequestMapping(value = "/validate/password", method = RequestMethod.GET)
 @ResponseBody
 public String validateOldPassword(
     @RequestHeader("X-Requested-With") String xRequestedWith, String oldpassword) {
   if ("XMLHttpRequest".equals(xRequestedWith)) {
     User user = ShiroUtil.getCurrentUser();
     if (user.getPassword().equals(oldpassword)) {
       return "true";
     }
     return "false";
   } else {
     throw new NotFoundException();
   }
 }
Esempio n. 2
0
  public void saveNotice(Notice notice) {

    notice.setUserid(ShiroUtil.getCurrentUserID());
    notice.setRealname(ShiroUtil.getCurrentRealName());
    noticeMapper.save(notice);
  }