由于laravel resource文件只在5.5版本后出现 所以要返回json 可以这样写: return response()->json(['data'=>$data]); 这样的返回的是这种格式:前面有个data