Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无效的请求-使用Ajax的Laravel_Php_Ajax_Laravel - Fatal编程技术网

Php 无效的请求-使用Ajax的Laravel

Php 无效的请求-使用Ajax的Laravel,php,ajax,laravel,Php,Ajax,Laravel,我正在使用Laravel,当我尝试使用Ajax请求时,我的终端在VS代码中显示此消息(在控制台中不显示任何消息): 我有这样一个Ajax代码: $.ajax({ type: "POST", url: "/comercial/relacoes/clientes/entrega-assinatura", data: { '_token': "{{ csrf_token() }}&

我正在使用Laravel,当我尝试使用Ajax请求时,我的终端在VS代码中显示此消息(在控制台中不显示任何消息):

我有这样一个Ajax代码:

$.ajax({
        type: "POST",
        url: "/comercial/relacoes/clientes/entrega-assinatura",
        data: {
            '_token': "{{ csrf_token() }}",
            'id_contato': "{{ $contato_id }}",
            'assinatura_gerente': $('#ass-gerente').attr('src'),
            'assinatura_cliente': $('#ass-cliente').attr('src'),
            'observacao': $('#observacoes').val(),
            'user_update': $('#input-hidden').val(),
        },
        success: function (response) {
            if(response.errors)
            {
                swal('Oops!', display_errors(response.errors), 'error');
                btn_enable(btn, btn_text);
            }
            else {
                swal_redirect('Ok!', response, 'success');
                console.log(response);
                btn_enable(btn, btn_text);
                window.open('/comercial/relacoes/clientes/ae2112f247772ea3e98aef75770435e6', '_self');
            }
        },
        error: function(response) {
            console.log(response);
            btn_enable(btn, btn_text);
        }
    });
路线:

Route::post('/relacoes/clientes/entrega-assinatura', 'Modules\Comercial\ComercialReqController@entrega_assinatura');
但有一点是不确定的:这个错误有时显示,但并不总是。。。但就用这条路线。

你应该更换 url:“/relacoes/clientes/entrega assinatura” 具有
url:“/commercial/relacoes/clientes/entrega assinatura”

我不懂葡萄牙语,但
“brindes cliente”
不是
”/relacoes/clientes/entrega assinatura'
。设置
数据类型:json
,如果有用,请检查。对不起,我编辑了这个问题。Ajax是不正确的,但现在是正确的correct@AliQorbani不工作
Route::post('/relacoes/clientes/entrega-assinatura', 'Modules\Comercial\ComercialReqController@entrega_assinatura');