|
...
|
...
|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\File; |
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Models\File\File;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Services\AmazonS3Service;
|
|
|
|
use App\Services\CosService;
|
|
|
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
|
|
|
use Illuminate\Http\JsonResponse;
|
|
...
|
...
|
@@ -125,10 +126,9 @@ class FileController |
|
|
|
$cosService = new CosService();
|
|
|
|
$cosService->uploadFile($files,$this->path,$fileName);
|
|
|
|
}else{
|
|
|
|
$res = $files->move($url,$fileName);
|
|
|
|
if ($res === false) {
|
|
|
|
return $this->response($files->getError(), Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
//TODO::上传亚马逊
|
|
|
|
$amazonS3Service = new AmazonS3Service();
|
|
|
|
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
|
|
|
|
}
|
|
|
|
$this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name);
|
|
|
|
$this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name));
|
|
...
|
...
|
@@ -165,7 +165,9 @@ class FileController |
|
|
|
$cosService = new CosService();
|
|
|
|
$cosService->uploadFile($files, $this->path, $fileName);
|
|
|
|
} else {
|
|
|
|
$res = $files->move($url, $fileName);
|
|
|
|
//TODO::上传亚马逊
|
|
|
|
$amazonS3Service = new AmazonS3Service();
|
|
|
|
$res = $amazonS3Service->uploadFiles($files,$this->path,$fileName);
|
|
|
|
if ($res === false) {
|
|
|
|
return [
|
|
|
|
'message' => $files->getError(),
|
|
...
|
...
|
@@ -238,10 +240,9 @@ class FileController |
|
|
|
$cosService = new CosService();
|
|
|
|
$cosService->uploadFile($files,$this->path,$fileName);
|
|
|
|
}else{
|
|
|
|
$res = $files->move($url,$fileName);
|
|
|
|
if ($res === false) {
|
|
|
|
return $this->response($files->getError(), Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
//TODO::上传亚马逊
|
|
|
|
$amazonS3Service = new AmazonS3Service();
|
|
|
|
$amazonS3Service->uploadFiles($files,$this->path,$fileName);
|
|
|
|
}
|
|
|
|
$size = $file->getSize();
|
|
|
|
$mime = $file->getMimeType();
|
...
|
...
|
|