tp5如何获取ajax请求的参数

浏览:14590 发布日期:2018/01/09 分类:ThinkPHP5专区 关键字: ajax tp5
前端代码     $.ajax({
        dataType : 'json',
        type : 'POST',
        url : '__URL__/notice/test',
        async : true,
        data : {
            "aoData" : 'aaaa'//测试数据 
        },
        success : function(data){
            alert(data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            alert(XMLHttpRequest.status + "," + textStatus);
        }
    }); 
后台代码:public function test(Request $request){     
        $aoData = $request->param('aoData');
        dump($aoData);
}
在调试中看到的结果是:nullD:\tools\wamp64\www\thinkphp5\thinkphp\library\think\Debug.php:165:null
最佳答案
评论( 相关
后面还有条评论,点击查看>>