| | |
| | | @RequestMapping(action + "checkGoogleAuthCodeForLogin.action") |
| | | public ModelAndView checkGoogleAuthCodeForLogin(HttpServletRequest request) { |
| | | |
| | | String google_auth_code = request.getParameter("google_auth_code"); |
| | | |
| | | ModelAndView model = new ModelAndView(); |
| | | String username = this.getUsername_login(); |
| | | try { |
| | | Syspara para = sysparaService.find("open_google_auth_code"); |
| | | if (null == para || para.getValue().equals("true")) { |
| | | googleAuthService.checkGoogleAuthCodeForLogin(this.getIp(), username, google_auth_code, |
| | | this.getRequest().getRequestURI()); |
| | | } |
| | | model.setViewName("redirect:/normal/LoginSuccessAction!view.action"); |
| | | return model; |
| | | |
| | | } catch (BusinessException e) { |
| | | model.addObject("error", e.getMessage()); |
| | | model.addObject("username", username); |
| | | model.setViewName("include/google_auth_code"); |
| | | return model; |
| | | } catch (Throwable t) { |
| | | logger.error(" error ", t); |
| | | model.addObject("username", username); |
| | | model.addObject("error", "验证码错误"); |
| | | model.setViewName("include/google_auth_code"); |
| | | return model; |
| | | } |
| | | } |
| | | |
| | | public void saveLog(SecUser secUser, String operator,String context) { |