thinkphp5 ajax调用后端出现error

浏览:411 发布日期:2020/09/26 分类:ThinkPHP5专区
thinkphp5 ajax调用后端始终进入error


js代码:
$.ajax({
type : "GET",
async:"false",
contentType: "application/json;charset=UTF-8",
url : "/api/",
success : function(result) {

},
error : function(e){
alert('error');
}
});

TP5代码:
public function api(){
$ret = $this->getScan();
return $ret
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>