|
...
|
...
|
@@ -207,11 +207,14 @@ class ImageController extends Controller |
|
|
|
if($this->upload_location == 0){
|
|
|
|
$watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0);
|
|
|
|
$cosService = new CosService();
|
|
|
|
$cosService->uploadFile($files,$this->path,$fileName,false,$watermarkOptions);
|
|
|
|
$res = $cosService->uploadFile($files,$this->path,$fileName,false,$watermarkOptions);
|
|
|
|
}else{
|
|
|
|
//TODO::上传亚马逊
|
|
|
|
$amazonS3Service = new AmazonS3Service();
|
|
|
|
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
|
|
|
|
$res = $amazonS3Service->uploadFiles($files,$this->path,$fileName);
|
|
|
|
}
|
|
|
|
if($res === false){
|
|
|
|
$this->response('上传失败,请重新上传',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$this->saveMysql($imageModel,$files->getSize(),$image_type,$fileName,$hash,$this->upload_location,$files->getMimeType(), $name);
|
|
|
|
$this->synchronizationImage($fileName,$this->upload_location);
|
|
...
|
...
|
@@ -354,11 +357,15 @@ class ImageController extends Controller |
|
|
|
if($this->upload_location == 0){
|
|
|
|
$watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0);
|
|
|
|
$cosService = new CosService();
|
|
|
|
$cosService->uploadFile($file,$this->path,$fileName,false,$watermarkOptions);
|
|
|
|
$res = $cosService->uploadFile($file,$this->path,$fileName,false,$watermarkOptions);
|
|
|
|
}else{
|
|
|
|
//TODO::上传亚马逊
|
|
|
|
$amazonS3Service = new AmazonS3Service();
|
|
|
|
$amazonS3Service->uploadFiles($file,$this->path,$fileName);
|
|
|
|
$res = $amazonS3Service->uploadFiles($file,$this->path,$fileName);
|
|
|
|
}
|
|
|
|
if($res === false){
|
|
|
|
outMessage('upload_images','文件上传失败'.$name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$this->synchronizationImage($fileName,$this->upload_location);
|
|
|
|
$data[] = $this->responseData($this->path.'/'.$fileName,$name);
|
...
|
...
|
|