示例#1
0
  /** 邮箱认证 */
  public static void checkEmail() {
    if (User.currUser().getIpsStatus() != IpsCheckStatus.NONE) {
      check();
    }

    ErrorInfo error = new ErrorInfo();
    User user = User.currUser();
    TemplateEmail.activeEmail(user, error);
    String email = user.email;
    String emailUrl = EmailUtil.emailUrl(email);

    BackstageSet set = BackstageSet.getCurrentBackstageSet();
    String phone = set.platformTelephone; // 电话号码
    String qq1 = set.companyQQ1; // QQ1
    String qq2 = set.companyQQ2; // QQ2

    render(email, emailUrl, phone, qq1, qq2);
  }
示例#2
0
  /** 发送激活邮件 */
  public void sendActiveEmail() {
    ErrorInfo error = new ErrorInfo();

    if (User.currUser().getIpsStatus() != IpsCheckStatus.NONE) {
      error.code = -1;
      error.msg = "非法请求";

      renderJSON(error);
    }

    User user = User.currUser();
    TemplateEmail.activeEmail(user, error);

    if (error.code >= 0) {
      error.msg = "激活邮件发送成功!";
    }

    renderJSON(error);
  }
示例#3
0
  /** ips认证(弹框) */
  public static void check() {
    int status = User.currUser().getIpsStatus();
    BackstageSet set = BackstageSet.getCurrentBackstageSet();
    String phone = set.companyTelephone; // 电话号码
    String qq1 = set.companyQQ1; // QQ1
    String qq2 = set.companyQQ2; // QQ2
    switch (status) {
      case IpsCheckStatus.EMAILISNULL:
        // finishEmail();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.EMAILISNULL) {
          check();
        }
        renderTemplate("/front/account/CheckAction/finishEmail.html", phone, qq1, qq2);
        break;
      case IpsCheckStatus.NONE:
        // checkEmail();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.NONE) {
          check();
        }
        ErrorInfo error = new ErrorInfo();
        User user = User.currUser();
        TemplateEmail.activeEmail(user, error);
        String email = user.email;
        String emailUrl = EmailUtil.emailUrl(email);

        renderTemplate(
            "/front/account/CheckAction/checkEmail.html", email, emailUrl, phone, qq1, qq2);
        break;
      case IpsCheckStatus.EMAIL:
        // checkEmailSuccess();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.EMAIL) {
          check();
        }

        renderTemplate("/front/account/CheckAction/checkEmailSuccess.html", phone, qq1, qq2);
        break;
      case IpsCheckStatus.REAL_NAME:
        // checkMobile();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.REAL_NAME) {
          check();
        }

        String companyName = set.companyName; // 公司名称

        renderTemplate("/front/account/CheckAction/checkMobile.html", companyName, phone, qq1, qq2);
        break;
      case IpsCheckStatus.MOBILE:
        // createIpsAcct();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.MOBILE) {
          check();
        }

        renderTemplate("/front/account/CheckAction/createIpsAcct.html", phone, qq1, qq2);
        break;
      case IpsCheckStatus.IPS:
        // checkSuccess();
        if (User.currUser().getIpsStatus() != IpsCheckStatus.IPS) {
          check();
        }

        renderTemplate("/front/account/CheckAction/checkSuccess.html");
        break;
      default:
        break;
    }
  }