作者 lyh

gx

... ... @@ -134,7 +134,7 @@ class FileController
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
}
$this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name);
$this->synchronizationFile($fileName,($this->upload_location == 0) ? 1 : 0);
$this->synchronizationFile($fileName,$this->upload_location);
$this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name));
}
... ... @@ -303,7 +303,7 @@ class FileController
$mime = $file->getMimeType();
$this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name);
$data[] = $this->responseData($this->path.'/'.$fileName, $name);
$this->synchronizationFile($fileName,($this->upload_location == 0) ? 1 : 0);
$this->synchronizationFile($fileName,$this->upload_location);
}
$this->response('资源',Code::SUCCESS,$data);
}
... ...
... ... @@ -215,7 +215,7 @@ class ImageController extends Controller
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
}
$this->saveMysql($imageModel,$files->getSize(),$image_type,$fileName,$hash,$this->upload_location,$files->getMimeType(), $name);
$this->synchronizationImage($fileName,($this->upload_location == 0) ? 1 : 0);
$this->synchronizationImage($fileName,$this->upload_location);
return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name));
}
... ... @@ -347,7 +347,7 @@ class ImageController extends Controller
}
//批量存储
$this->saveMysql($imageModel,$file->getSize(),$image_type,$fileName,$hash,$this->upload_location,$file->getMimeType(),$name);
$this->synchronizationImage($fileName,($this->upload_location == 0) ? 1 : 0);
$this->synchronizationImage($fileName,$this->upload_location);
$data[] = $this->responseData($this->path.'/'.$fileName,$name);
}
$this->response('图片资源',Code::SUCCESS,$data);
... ...
... ... @@ -72,7 +72,7 @@ class SyncImageFileJob implements ShouldQueue
if(substr($path,0,2) == '//'){
return 'https:'.$path;
}
if($location == 1){
if($location == 0){
$cos = config('filesystems.disks.cos');
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
$url = $cosCdn.$path;
... ...