Ejemplo n.º 1
0
 // 自动发送邮件
 @Action(value = "sendEmailRandom")
 public void sendEmailRandom() {
   String ZQS = AuthImg.getNumber(6);
   session.put(Const.SECURITY_CODE, ZQS);
   System.out.println(getParameter("p_flag"));
   succMess =
       userService.sendEmail(model.getEmail(), "您在倍力康商城上的验证码为" + ZQS, getParameter("p_flag"));
   writeStringToResponse(succMess);
 }
Ejemplo n.º 2
0
 // 自动获取手机的验证码
 @Action(value = "sendPhoneRandom")
 public void sendPhoneRandom() throws Exception {
   String ZqsPhoneNum = AuthImg.getNumber(6);
   session.put(Const.SECURITY_CODE, ZqsPhoneNum);
   Map<String, String> params = new HashMap<String, String>();
   params.put("phoneNumber", model.getPhone());
   params.put("securityCode", ZqsPhoneNum);
   params.put("pType", getParameter("p_type"));
   succMess = userService.sendPhone(getParameter("p_flag"), params);
   System.out.println("==============" + succMess);
   writeStringToResponse(succMess);
 }
Ejemplo n.º 3
0
 /** 使用手机号找回密码 */
 @Action(
     value = "findPasswordByPhone",
     results = {@Result(name = ERROR, location = WEB + "findPassword.jsp")})
 public String findPasswordByPhone() {
   succMess =
       userService.findPasswordByPhone(
           model.getPhone(),
           getParameter(Const.SECURITY_CODE),
           AuthImg.getChar(8),
           request,
           session);
   if (succMess.equals(Const.TRUE)) {
     initPage("找回密码", "密码找回成功", "恭喜,新密码已经发送到你的手机,登陆后你可以到个人中心修改密码");
     setReturnPage("index", "首页");
     return SUCCESS;
   } else {
     return ERROR;
   }
 }
Ejemplo n.º 4
0
 /**
  * 使用邮箱找回密码
  *
  * <p>*
  */
 @Action(
     value = "findPasswordByEmail",
     results = {@Result(name = ERROR, location = WEB + "findPassword.jsp")})
 public String findPassword() {
   succMess =
       userService.findPassword(
           model.getEmail(),
           getParameter(Const.SECURITY_CODE),
           AuthImg.getChar(8),
           request,
           session);
   if (succMess.equals(Const.TRUE)) {
     if (model.getEmail().endsWith("@qq.com")) {
       initPage("找回密码", "密码找回成功", "恭喜,新密码已经发送你的QQ邮箱,请注意查收!请注意邮件是否被拦截至垃圾箱,登录后您可在“安全设置页面”修改密码。");
     } else {
       initPage("找回密码", "密码找回成功", "恭喜,新密码已发送到你的邮箱,请注意查收!登录后您可在“安全设置页面”修改密码。");
     }
     setReturnPage("index", "首页");
     return SUCCESS;
   } else {
     return ERROR;
   }
 }