|
@@ -5,6 +5,7 @@ use App\Exports\MyExport;
|
|
|
use App\Service\FileUploadService;
|
|
|
use App\Service\OssService;
|
|
|
use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Storage;
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F;
|
|
|
|
|
|
//文件上传
|
|
@@ -29,6 +30,9 @@ class FileUploadController extends BaseController
|
|
|
$date = $date->format('Y-m-d');
|
|
|
$path = storage_path() . "/app/public/" . FileUploadService::tmp_dir . '/' . $date. '/' . $file_name;
|
|
|
|
|
|
+ // 返回一个错误响应或默认图片
|
|
|
+ if (! Storage::exists($path)) return response()->json(201, "File not exists");
|
|
|
+
|
|
|
return response()->file($path);
|
|
|
}
|
|
|
|