有没有办法获得受jwt保护的图像?
laravel route:
$api->get('images/{slug}', ['uses' => 'App\Api\V1\Controllers\ImagesController@show']);
laravel show method:
public function show($imgid)
{
if(Auth::check())
{
$path = Config::get('fms.images.thumbnail') . '/' . $image->thumbnail;
return \Intervention\Image\Facades\Image::make($path)->response();
} else
{
return null;
}
}
vue img:
<img :src="imgurl(photo.id)">
vue imgurl method
imgurl(imgid) {
return "/api/images/" + imgid
}
返回400,因为我没有通过身份验证
感谢