作者 lyh

gx

... ... @@ -25,13 +25,10 @@ class CopyImageFileListener implements ShouldQueue
*/
public function handle(CopyImageFile $event)
{
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('进入', true) . PHP_EOL, FILE_APPEND);
$this->param = $event->data;
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->param, true) . PHP_EOL, FILE_APPEND);
$imageModel = new ImageModel();
//获取当前项目的所有图片
$imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos']);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($imageList, true) . PHP_EOL, FILE_APPEND);
if(!empty($imageList)){
$amazonS3Service = new AmazonS3Service();
foreach ($imageList as $k => $v){
... ...
... ... @@ -76,6 +76,7 @@ class AmazonS3Service
]);
return $result['ObjectURL'];
} catch (AwsException $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('图片:'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
return '上传文件到S3时发生错误:' . $e->getMessage();
}
}
... ...