示例#1
0
  /**
   * 发送短信验证码
   *
   * @param mobile
   */
  public static void sendCode(String mobile) {
    ErrorInfo error = new ErrorInfo();
    flash.put("mobile", mobile);

    if (StringUtils.isBlank(mobile)) {
      flash.error("手机号码不能为空");
    }

    if (!RegexUtils.isMobileNum(mobile)) {
      flash.error("请输入正确的手机号码");
    }

    SMSUtil.sendCode(mobile, error);

    if (error.code < 0) {
      flash.error(error.msg);
    }

    flash.put("isSending", true);

    checkMobile();
  }