/**
  * 保存页面
  *
  * @param request
  * @return
  */
 @ResponseBody
 @RequestMapping(value = "save.json")
 @JRadOperation(JRadOperation.DISPLAY)
 public JRadReturnMap save(HttpServletRequest request) {
   JRadReturnMap returnMap = new JRadReturnMap();
   try {
     managerAssessmentScoreService.saveAssessmentScore(request);
     returnMap.addGlobalMessage(CHANGE_SUCCESS);
     return returnMap;
   } catch (Exception e) {
     return WebRequestHelper.processException(e);
   }
 }
Exemplo n.º 2
0
  public JRadReturnMap innerAdminLogin(HttpServletRequest request) {

    JRadReturnMap returnMap = new JRadReturnMap();

    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String ipAddress = request.getRemoteAddr();

    try {
      AuthResult authResult = authMgr.authUserByLogin(username, password);
      AuthResultType authResultType = authResult.getResultType();

      Errors errors = new Errors();
      String errorCode = null;
      if (AuthResultType.AUTH_ACCOUNT_NOT_EXIST.equals(authResultType)) {
        errorCode = "system.auth.accountNotExist";
      } else if (AuthResultType.AUTH_ACCOUNT_PASSWORD_ERROR.equals(authResultType)) {
        errorCode = "system.auth.passwordError";
      } else if (AuthResultType.AUTH_ACCOUNT_NOT_ACTIVE.equals(authResultType)) {
        errorCode = "system.auth.accountNotActive";
      } else if (AuthResultType.AUTH_ACCOUNT_NOT_LOCAL.equals(authResultType)) {
        //				errorCode = "system.auth.accountNotLocal";
      }

      String signInMsg = null;
      if (errorCode != null) {
        signInMsg = i18nHelper.getMessage(errorCode);
        errors.addGlobalError(errorCode);
        returnMap.setSuccess(false);
        returnMap.setErrors(errors);
      } else {
        IUser user = authResult.getUser();
        loginManager.login(user, request);
        request.getSession().setMaxInactiveInterval(300); // added by nihc 20150710 session超时
        signInMsg = i18nHelper.getMessage("system.auth.success");
      }

      loginLogManager.addSignInLog(username, LoginManager.LOCAL, ipAddress, signInMsg);
    } catch (Exception ex) {
      return WebRequestHelper.processException(ex);
    }

    return returnMap;
  }