Laravel:有效负载无效

问题描述 投票:0回答:1

如何解决这个错误 -

有效负载无效。 C:.. \供应商\ laravel \框架的\ src \照亮\加密\ Encrypter.php#191

我在发送ajax post请求时得到了它。

<input name="telephone" type="tel" value="" id="phone-number">
<button class="button" type="submit" id='sendSMS' onclick="clickFunction(event, this);">Send SMS</button>

这是我的JS代码 -

(function() {
    $('#add-announcement').on('click', '#sendSMS', function() {
        $.ajaxSetup({
            headers: {
                'X-XSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
            },
        });

        $.ajax({
            type: 'POST',
            url: window.url,
            dataType: 'JSON',
            success: function(data) {
                // alert(data);
            },
            error: function(jqXHR, textStatus, errorThrown) { // What to do if we fail
                console.log(
                    'AJAX error: ' + textStatus + ' : ' + errorThrown);
            },
        });

        return false;
    });
})();
ajax laravel
1个回答
0
投票

问题解决了,问题是在axaj查询中,查询不正确。

© www.soinside.com 2019 - 2024. All rights reserved.