|
...
|
...
|
@@ -6,6 +6,8 @@ use App\Enums\Common\Code; |
|
|
|
use App\Helper\Translate;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Http\Controllers\type;
|
|
|
|
use App\Jobs\CopyProjectJob;
|
|
|
|
use App\Jobs\SyncImageFileJob;
|
|
|
|
use App\Models\File\ErrorFile;
|
|
|
|
use App\Models\File\Image as ImageModel;
|
|
|
|
use App\Models\Project\Project;
|
|
...
|
...
|
@@ -262,14 +264,14 @@ class ImageController extends Controller |
|
|
|
* @time :2024/4/8 11:10
|
|
|
|
*/
|
|
|
|
public function synchronizationImage($fileName){
|
|
|
|
//同步到大文件
|
|
|
|
$file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0);
|
|
|
|
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
|
|
|
|
$code = shell_exec($cmd);
|
|
|
|
if(200 != (int)$code){
|
|
|
|
$errorFileModel = new ErrorFile();
|
|
|
|
$errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
|
|
|
|
}
|
|
|
|
SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]);
|
|
|
|
// $file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0);
|
|
|
|
// $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
|
|
|
|
// $code = shell_exec($cmd);
|
|
|
|
// if(200 != (int)$code){
|
|
|
|
// $errorFileModel = new ErrorFile();
|
|
|
|
// $errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
|
|
|
|
// }
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|