|
@@ -35,13 +35,26 @@ class AiVideoController extends BaseController |
|
@@ -35,13 +35,26 @@ class AiVideoController extends BaseController |
|
35
|
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
|
35
|
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
|
|
36
|
}
|
36
|
}
|
|
37
|
$cosService = new CosService();
|
37
|
$cosService = new CosService();
|
|
38
|
- $imagePath = $cosService->uploadRemote(1,'video',$data['url']);
|
|
|
|
39
|
- if($imagePath){
|
|
|
|
40
|
- //裁剪图片为4张
|
|
|
|
41
|
- }else{
|
|
|
|
42
|
- Log::channel('ai_video')->info('上传图片失败');
|
38
|
+ $imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
|
|
|
|
39
|
+ try {
|
|
|
|
40
|
+ if($imagePath){
|
|
|
|
41
|
+ $cos = config('filesystems.disks.cos');
|
|
|
|
42
|
+ $url = $cos['cdn1'].'/'.$imagePath;
|
|
|
|
43
|
+ //裁剪图片为4张
|
|
|
|
44
|
+ $cosService = new CosService();
|
|
|
|
45
|
+ $images = [];
|
|
|
|
46
|
+ $data = $cosService->cropAndUploadToCOS($url);
|
|
|
|
47
|
+ if(!empty($data)){
|
|
|
|
48
|
+ foreach ($data as $item){
|
|
|
|
49
|
+ $images[] = ['url'=>$item,'alt'=>''];
|
|
|
|
50
|
+ }
|
|
|
|
51
|
+ }
|
|
|
|
52
|
+ $images = array_merge($images,$info['images']);
|
|
|
|
53
|
+ $aiVideoAutoLogModel->edit(['images'=>$images,'result'=>json_encode($this->param,true)],['id'=>$info['id']]);
|
|
|
|
54
|
+ }
|
|
|
|
55
|
+ }catch (\Exception $e){
|
|
|
|
56
|
+ Log::channel('ai_video')->info('上传图片失败'.$e->getMessage());
|
|
43
|
}
|
57
|
}
|
|
44
|
-
|
|
|
|
45
|
$this->response('success');
|
58
|
$this->response('success');
|
|
46
|
}
|
59
|
}
|
|
47
|
} |
60
|
} |