Esempio n. 1
0
 /**
  * 修改当前登录用户信息
  *
  * @param
  * @return
  */
 public ActionForward updateUserInfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm cForm = (CommonActionForm) form;
   UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
   UserService service = (UserService) getService("userService");
   Dto indDto = cForm.getParamAsDto(request);
   Dto outDto = new BaseDto(G4Constants.TRUE);
   outDto.put("flag", G4Constants.SUCCESS);
   String password = G4Utils.encryptBasedDes(indDto.getAsString("password2"));
   if (password.equals(userInfoVo.getPassword())) {
     service.updateUserItem4IndexPage(indDto);
     outDto.put("flag", G4Constants.SUCCESS);
     userInfoVo.setPassword(G4Utils.encryptBasedDes(indDto.getAsString("password1")));
     getSessionContainer(request).setUserInfo(userInfoVo);
   } else {
     outDto.setSuccess(G4Constants.FALSE);
     outDto.put("flag", G4Constants.FAILURE);
   }
   write(outDto.toJson(), response);
   return mapping.findForward(null);
 }
Esempio n. 2
0
 /**
  * 修改参数信息
  *
  * @param
  * @return
  */
 public ActionForward updateParamItem(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm aForm = (CommonActionForm) form;
   Dto inDto = aForm.getParamAsDto(request);
   paramService.updateParamItem(inDto);
   Dto outDto = new BaseDto();
   outDto.put("success", new Boolean(true));
   outDto.put("msg", "参数数据修改成功!");
   write(outDto.toJson(), response);
   return mapping.findForward(null);
 }
Esempio n. 3
0
 /**
  * 解锁系统
  *
  * @param
  * @return
  */
 public ActionForward unlockSystem(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm cForm = (CommonActionForm) form;
   UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
   Dto indDto = cForm.getParamAsDto(request);
   String password = G4Utils.encryptBasedDes(indDto.getAsString("password"));
   Dto outDto = new BaseDto(G4Constants.TRUE);
   if (password.equals(userInfoVo.getPassword())) {
     outDto.put("flag", G4Constants.SUCCESS);
   } else {
     outDto.put("flag", G4Constants.FAILURE);
   }
   write(outDto.toJson(), response);
   return mapping.findForward(null);
 }