有思俱乐部学习园地

手机验证码


语法格式:

                
    手机验证码
    地址:http://short.1473.cn/postnumber
    方法:post
    参数:
    1,userphone 用户手机
    状态码:201表示成功
    返回值说明:无

    验证手机验证码
    地址:http://short.1473.cn/verifi
    方法:post
    参数:
    1,userphonetext 用户手机验证码
    状态码:201表示成功
    返回值说明:
    1,err:错误说明

    示例:
    获取验证码
    function loadDoc() {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 201) {
        alert('发送成功')
        }
    };
    xhttp.open("POST", "http://short.1473.cn/postnumber", true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.withCredentials = true;
    xhttp.send("number="+document.querySelectorAll('#userphone')[0].value);
    }

    验证验证码
    function loadDocer() {
    let xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 201) {
            alert('验证码正确')
        }
    };
    xhttp.open("POST", "http://short.1473.cn/verifi", true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.withCredentials = true;
    xhttp.send("code="+document.querySelectorAll('#cat')[0].value);
    }
                
            

工作人员

                

作者:代英杰

信息录入:代英杰