function sendValidationCode() {
    var login = $("input[name='login']").val()
    var tel = $("input[name='tel']").val()
    var validationSend = $('.validation-send')
    var csrf_token = $("input[name='csrf_token']").val()
    $.ajax({
        type: "GET",
        url: '/web/sent/message',
        data: {
            'login': login,
            'tel': tel
        },
        dataType: "json",
        success: function (data) {
            var count = 60;
            validationSend.attr('disabled', true);
            validationSend.css('background-color', 'gray');
            var interval = setInterval(function () {
                if (count === 0) {
                    clearInterval(interval);
                    validationSend.attr('disabled', false);
                    validationSend.css('background-color', '');
                    setTimeout(function () {
                        validationSend.html('获取验证码');
                    }, 1000);
                }
                validationSend.html(count);
                count--;
            }, 1000)
            $('#getSentTimes').css('display', 'block');
            $('#getSentTimes p').html("你已获取" + data.send_times + "次验证码,一天最多5次！")
            setTimeout(function () {
                        $('#getSentTimes').css('display', 'none');
                    }, 3000);
        },
        error: function (data) {
            console.log("ERROR ", data);
        }
    });
}

function validate() {
    var pwd1 = $("input[name='newPassword']").val()
    var pwd2 = $("input[name='confirmPassword']").val()
    if (pwd1 != pwd2) {
        $("button[type='submit']").attr('disabled', true);
        $("#passwordWarning").css('display', 'block');
    }
    else {
        $("button[type='submit']").attr('disabled', false);
        $("#passwordWarning").css('display', 'none');
    }
}