正在显示
3 个修改的文件
包含
5 行增加
和
5 行删除
| @@ -134,7 +134,7 @@ class FileController | @@ -134,7 +134,7 @@ class FileController | ||
| 134 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); | 134 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); |
| 135 | } | 135 | } |
| 136 | $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name); | 136 | $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name); |
| 137 | - $this->synchronizationFile($fileName,($this->upload_location == 0) ? 1 : 0); | 137 | + $this->synchronizationFile($fileName,$this->upload_location); |
| 138 | $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); | 138 | $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| @@ -303,7 +303,7 @@ class FileController | @@ -303,7 +303,7 @@ class FileController | ||
| 303 | $mime = $file->getMimeType(); | 303 | $mime = $file->getMimeType(); |
| 304 | $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name); | 304 | $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name); |
| 305 | $data[] = $this->responseData($this->path.'/'.$fileName, $name); | 305 | $data[] = $this->responseData($this->path.'/'.$fileName, $name); |
| 306 | - $this->synchronizationFile($fileName,($this->upload_location == 0) ? 1 : 0); | 306 | + $this->synchronizationFile($fileName,$this->upload_location); |
| 307 | } | 307 | } |
| 308 | $this->response('资源',Code::SUCCESS,$data); | 308 | $this->response('资源',Code::SUCCESS,$data); |
| 309 | } | 309 | } |
| @@ -215,7 +215,7 @@ class ImageController extends Controller | @@ -215,7 +215,7 @@ class ImageController extends Controller | ||
| 215 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); | 215 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); |
| 216 | } | 216 | } |
| 217 | $this->saveMysql($imageModel,$files->getSize(),$image_type,$fileName,$hash,$this->upload_location,$files->getMimeType(), $name); | 217 | $this->saveMysql($imageModel,$files->getSize(),$image_type,$fileName,$hash,$this->upload_location,$files->getMimeType(), $name); |
| 218 | - $this->synchronizationImage($fileName,($this->upload_location == 0) ? 1 : 0); | 218 | + $this->synchronizationImage($fileName,$this->upload_location); |
| 219 | return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); | 219 | return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| @@ -347,7 +347,7 @@ class ImageController extends Controller | @@ -347,7 +347,7 @@ class ImageController extends Controller | ||
| 347 | } | 347 | } |
| 348 | //批量存储 | 348 | //批量存储 |
| 349 | $this->saveMysql($imageModel,$file->getSize(),$image_type,$fileName,$hash,$this->upload_location,$file->getMimeType(),$name); | 349 | $this->saveMysql($imageModel,$file->getSize(),$image_type,$fileName,$hash,$this->upload_location,$file->getMimeType(),$name); |
| 350 | - $this->synchronizationImage($fileName,($this->upload_location == 0) ? 1 : 0); | 350 | + $this->synchronizationImage($fileName,$this->upload_location); |
| 351 | $data[] = $this->responseData($this->path.'/'.$fileName,$name); | 351 | $data[] = $this->responseData($this->path.'/'.$fileName,$name); |
| 352 | } | 352 | } |
| 353 | $this->response('图片资源',Code::SUCCESS,$data); | 353 | $this->response('图片资源',Code::SUCCESS,$data); |
| @@ -72,7 +72,7 @@ class SyncImageFileJob implements ShouldQueue | @@ -72,7 +72,7 @@ class SyncImageFileJob implements ShouldQueue | ||
| 72 | if(substr($path,0,2) == '//'){ | 72 | if(substr($path,0,2) == '//'){ |
| 73 | return 'https:'.$path; | 73 | return 'https:'.$path; |
| 74 | } | 74 | } |
| 75 | - if($location == 1){ | 75 | + if($location == 0){ |
| 76 | $cos = config('filesystems.disks.cos'); | 76 | $cos = config('filesystems.disks.cos'); |
| 77 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | 77 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; |
| 78 | $url = $cosCdn.$path; | 78 | $url = $cosCdn.$path; |
-
请 注册 或 登录 后发表评论