|
|
|
|
@ -166,11 +166,13 @@ class HealthCertificateController extends Controller
|
|
|
|
|
$filePath = 'health_certificate/photo/' . date('Ymd') . '/' . $fileName;
|
|
|
|
|
|
|
|
|
|
// 使用本地磁盘写入文件
|
|
|
|
|
Storage::disk('public')->put($filePath, $imageData);
|
|
|
|
|
// Storage::disk('public')->put($filePath, $imageData);
|
|
|
|
|
|
|
|
|
|
// 构建访问 URL 或者直接存相对路径
|
|
|
|
|
$photoPath = '/storage/' . $filePath;
|
|
|
|
|
// $photoPath = '/storage/' . $filePath;
|
|
|
|
|
|
|
|
|
|
$upUrl= Storage::disk('network_drive')->put('/phpUpload/'.$filePath, $imageData);
|
|
|
|
|
$photoPath=Storage::disk('network_drive')->url('/phpUpload/'.$filePath);
|
|
|
|
|
// 获取所有数据
|
|
|
|
|
$data = $request->except(['photo']);
|
|
|
|
|
|
|
|
|
|
@ -232,6 +234,7 @@ class HealthCertificateController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$file = $request->file('file');
|
|
|
|
|
// Storage::disk('network_drive')->put('', $file);
|
|
|
|
|
|
|
|
|
|
if (!$key || $key !== '5Kj9P1pL0f8e7Vw3I2qX4mT6zJ1OxWcQ') {
|
|
|
|
|
return response()->json([
|
|
|
|
|
@ -285,11 +288,13 @@ class HealthCertificateController extends Controller
|
|
|
|
|
], 400);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 生成唯一文件名
|
|
|
|
|
$filename = uniqid() . '_' . mt_rand(0, 999999) . '.' . $file_extension;
|
|
|
|
|
|
|
|
|
|
$path = $file->store($path, 'public');
|
|
|
|
|
$url = '/storage/' . $path ;
|
|
|
|
|
// $path = $file->store($path, 'public');
|
|
|
|
|
// $url = '/storage/' . $path ;
|
|
|
|
|
// dd('/phpUpload/'.$path.'/'.$filename);
|
|
|
|
|
$upUrl= Storage::disk('network_drive')->put('/phpUpload/'.$path, $file);
|
|
|
|
|
$url=Storage::disk('network_drive')->url($upUrl);
|
|
|
|
|
$data=[
|
|
|
|
|
'hospitalCode' => $hospitalCode,
|
|
|
|
|
'hospitalName' => $hospitalName,
|
|
|
|
|
|