作者 lyh

gx

... ... @@ -130,7 +130,7 @@ class FileController
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
}
$this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name);
$this->synchronizationFile($files->getClientOriginalExtension(),$fileName);
$this->synchronizationFile($fileName);
$this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name));
}
... ... @@ -141,7 +141,7 @@ class FileController
* @method :post
* @time :2024/4/8 11:10
*/
public function synchronizationFile($file_type,$fileName){
public function synchronizationFile($fileName){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName;
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
... ... @@ -262,7 +262,7 @@ class FileController
$mime = $file->getMimeType();
$this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name);
$data[] = $this->responseData($this->path.'/'.$fileName, $name);
$this->synchronizationFile($file_type,$fileName);
$this->synchronizationFile($fileName);
}
$this->response('资源',Code::SUCCESS,$data);
}
... ...