|
...
|
...
|
@@ -35,13 +35,26 @@ class AiVideoController extends BaseController |
|
|
|
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
|
|
|
|
}
|
|
|
|
$cosService = new CosService();
|
|
|
|
$imagePath = $cosService->uploadRemote(1,'video',$data['url']);
|
|
|
|
$imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
|
|
|
|
try {
|
|
|
|
if($imagePath){
|
|
|
|
$cos = config('filesystems.disks.cos');
|
|
|
|
$url = $cos['cdn1'].'/'.$imagePath;
|
|
|
|
//裁剪图片为4张
|
|
|
|
}else{
|
|
|
|
Log::channel('ai_video')->info('上传图片失败');
|
|
|
|
$cosService = new CosService();
|
|
|
|
$images = [];
|
|
|
|
$data = $cosService->cropAndUploadToCOS($url);
|
|
|
|
if(!empty($data)){
|
|
|
|
foreach ($data as $item){
|
|
|
|
$images[] = ['url'=>$item,'alt'=>''];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$images = array_merge($images,$info['images']);
|
|
|
|
$aiVideoAutoLogModel->edit(['images'=>$images,'result'=>json_encode($this->param,true)],['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
Log::channel('ai_video')->info('上传图片失败'.$e->getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|