作者 lyh

gx

... ... @@ -68,7 +68,6 @@ class AmazonS3Service
{
$key = str_replace_url($files);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND);
$body = $files;
try {
$result = $this->s3->putObject([
... ... @@ -76,6 +75,8 @@ class AmazonS3Service
'Key' => $key,
'Body' => file_get_contents($body),
]);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
return $result['ObjectURL'];
} catch (AwsException $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('图片:'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
... ...