* @return
*/
@RequestMapping(value = "/password/modify", method = RequestMethod.POST)
public ModelAndView modifyPasswordExecute(String password, String newPassword, String newPasswordConfirm) {
ModelAndView mav = new ModelAndView();
User userInSession = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
Long triedTime = (Long) WebHelper.getSessionAttribute(null, Constant.SESSION_MIDIFY_PSWD_TRY_TIME);
if (triedTime == null) {
triedTime = (long) 0;
}
if (userInSession != null && userInSession.getId() != 0 && triedTime < 2) {
if (newPassword.equals(newPasswordConfirm)) {
mav.addObject("errorMessage", "您两次所输入的密码不一致,请重试!");
} else {
boolean modifyResult = accountInfoService.modifyPassword(userInSession.getEmail(), password, newPassword);
if (modifyResult == false) {
WebHelper.setSessionAttribute(null, Constant.SESSION_MIDIFY_PSWD_TRY_TIME, triedTime + 1);
mav.addObject("errorMessage", "您所输入的密码不正确,请重试!");
mav.setViewName(ViewPaths.USER_MODIFYPASSWORD);
} else {