//后台管理员验证方法 public function check(Request $request){ //初始返回的三个参数 $status = 0; $result = ''; $data = $request->param(); //return ['status'=>$status,'message'=>$result,'data'=>$data]; $returnVar=array('status'=>$status,'message'=>$result,'data'=>$data); //dump($returnVar); //能正确显示 return $returnVar; //返回给前端为什么会提示返回数据类型错误呢? }
Why can’t I use return to return an array? Why does an error occur?
tp5 control layer returns json by default
Supplement: Can’t the tp5 array be returned with return?