Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
4 个修改的文件
包含
31 行增加
和
11 行删除
| @@ -311,13 +311,4 @@ class LoginController extends BaseController | @@ -311,13 +311,4 @@ class LoginController extends BaseController | ||
| 311 | } | 311 | } |
| 312 | return $data; | 312 | return $data; |
| 313 | } | 313 | } |
| 314 | - | ||
| 315 | - public function ceshi(){ | ||
| 316 | - //同步到大文件 | ||
| 317 | - $path = '/upload/m/video/2023-08'; | ||
| 318 | - $fileName = '64e81b9b80b1331590.mp4'; | ||
| 319 | - $file_path = config('filesystems.disks.cos')['cdn1'].$path.'/'.$fileName; | ||
| 320 | - $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$path.'" https://v6-file.globalso.com/upload.php'; | ||
| 321 | - echo shell_exec($cmd); | ||
| 322 | - } | ||
| 323 | } | 314 | } |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Controllers\File; | 3 | namespace App\Http\Controllers\File; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Models\File\ErrorFile; | ||
| 6 | use App\Models\File\File; | 7 | use App\Models\File\File; |
| 7 | use App\Models\Project\Project; | 8 | use App\Models\Project\Project; |
| 8 | use App\Services\AmazonS3Service; | 9 | use App\Services\AmazonS3Service; |
| @@ -145,7 +146,12 @@ class FileController | @@ -145,7 +146,12 @@ class FileController | ||
| 145 | //同步到大文件 | 146 | //同步到大文件 |
| 146 | $file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName; | 147 | $file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName; |
| 147 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; | 148 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; |
| 148 | - shell_exec($cmd); | 149 | + $code = shell_exec($cmd); |
| 150 | + if(200 != (int)$code){ | ||
| 151 | + $errorFileModel = new ErrorFile(); | ||
| 152 | + $errorFileModel->add(['path'=>$this->path.'/'.$fileName]); | ||
| 153 | + } | ||
| 154 | + return true; | ||
| 149 | } | 155 | } |
| 150 | 156 | ||
| 151 | /** | 157 | /** |
| @@ -5,6 +5,7 @@ namespace App\Http\Controllers\File; | @@ -5,6 +5,7 @@ namespace App\Http\Controllers\File; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Controller; | 6 | use App\Http\Controllers\Controller; |
| 7 | use App\Http\Controllers\type; | 7 | use App\Http\Controllers\type; |
| 8 | +use App\Models\File\ErrorFile; | ||
| 8 | use App\Models\File\Image as ImageModel; | 9 | use App\Models\File\Image as ImageModel; |
| 9 | use App\Models\Project\Project; | 10 | use App\Models\Project\Project; |
| 10 | use App\Services\AmazonS3Service; | 11 | use App\Services\AmazonS3Service; |
| @@ -225,7 +226,12 @@ class ImageController extends Controller | @@ -225,7 +226,12 @@ class ImageController extends Controller | ||
| 225 | //同步到大文件 | 226 | //同步到大文件 |
| 226 | $file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0); | 227 | $file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0); |
| 227 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; | 228 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; |
| 228 | - shell_exec($cmd); | 229 | + $code = shell_exec($cmd); |
| 230 | + if(200 != (int)$code){ | ||
| 231 | + $errorFileModel = new ErrorFile(); | ||
| 232 | + $errorFileModel->add(['path'=>$this->path.'/'.$fileName]); | ||
| 233 | + } | ||
| 234 | + return true; | ||
| 229 | } | 235 | } |
| 230 | 236 | ||
| 231 | /** | 237 | /** |
app/Models/File/ErrorFile.php
0 → 100644
-
请 注册 或 登录 后发表评论