|
@@ -28,10 +28,11 @@ class FileUploadController extends BaseController
|
|
$timestamp = substr($file_name, 0, 8); // 截取前八位数字
|
|
$timestamp = substr($file_name, 0, 8); // 截取前八位数字
|
|
$date = \DateTime::createFromFormat('Ymd', $timestamp);
|
|
$date = \DateTime::createFromFormat('Ymd', $timestamp);
|
|
$date = $date->format('Y-m-d');
|
|
$date = $date->format('Y-m-d');
|
|
- $path = storage_path() . "/app/public/" . FileUploadService::tmp_dir . '/' . $date. '/' . $file_name;
|
|
|
|
|
|
+ $dir = FileUploadService::tmp_dir . '/' . $date. '/' . $file_name;
|
|
|
|
+ $path = storage_path() . "/app/public/" . $dir;
|
|
|
|
|
|
// 返回一个错误响应或默认图片
|
|
// 返回一个错误响应或默认图片
|
|
- if (! Storage::exists($path)) return $this->json_return(201,'File not exists');
|
|
|
|
|
|
+ if (! Storage::disk('public')->exists($dir)) return $this->json_return(201,'File not exists');
|
|
|
|
|
|
return response()->file($path);
|
|
return response()->file($path);
|
|
}
|
|
}
|