作者 lyh

gx

... ... @@ -3,6 +3,7 @@
namespace App\Http\Controllers\File;
use App\Enums\Common\Code;
use App\Models\File\ErrorFile;
use App\Models\File\File;
use App\Models\Project\Project;
use App\Services\AmazonS3Service;
... ... @@ -145,7 +146,12 @@ class FileController
//同步到大文件
$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';
shell_exec($cmd);
$code = shell_exec($cmd);
if(200 != (int)$code){
$errorFileModel = new ErrorFile();
$errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
}
return true;
}
/**
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Controllers\File;
use App\Enums\Common\Code;
use App\Http\Controllers\Controller;
use App\Http\Controllers\type;
use App\Models\File\ErrorFile;
use App\Models\File\Image as ImageModel;
use App\Models\Project\Project;
use App\Services\AmazonS3Service;
... ... @@ -225,7 +226,11 @@ class ImageController extends Controller
//同步到大文件
$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';
shell_exec($cmd);
$code = shell_exec($cmd);
if(200 != (int)$code){
$errorFileModel = new ErrorFile();
$errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
}
}
/**
... ...
<?php
/**
* @remark :
* @name :ErrorFile.php
* @author :lyh
* @method :post
* @time :2024/4/16 17:00
*/
namespace App\Models\File;
use App\Models\Base;
class ErrorFile extends Base
{
protected $table = 'gl_error_file';
}
... ...