作者 lyh

gx

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\File; @@ -4,6 +4,7 @@ namespace App\Http\Controllers\File;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
6 use App\Helper\Translate; 6 use App\Helper\Translate;
  7 +use App\Jobs\SyncImageFileJob;
7 use App\Models\File\ErrorFile; 8 use App\Models\File\ErrorFile;
8 use App\Models\File\File; 9 use App\Models\File\File;
9 use App\Models\File\Image as ImageModel; 10 use App\Models\File\Image as ImageModel;
@@ -146,13 +147,7 @@ class FileController @@ -146,13 +147,7 @@ class FileController
146 */ 147 */
147 public function synchronizationFile($fileName){ 148 public function synchronizationFile($fileName){
148 //同步到大文件 149 //同步到大文件
149 - $file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName;  
150 - $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';  
151 - $code = shell_exec($cmd);  
152 - if(200 != (int)$code){  
153 - $errorFileModel = new ErrorFile();  
154 - $errorFileModel->add(['path'=>$this->path.'/'.$fileName]);  
155 - } 150 + SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]);
156 return true; 151 return true;
157 } 152 }
158 153