|
@@ -20,7 +20,7 @@ class CosService |
|
@@ -20,7 +20,7 @@ class CosService |
|
20
|
* @method :post
|
20
|
* @method :post
|
|
21
|
* @time :2023/7/19 15:28
|
21
|
* @time :2023/7/19 15:28
|
|
22
|
*/
|
22
|
*/
|
|
23
|
- public function uploadFile($path,$filename)
|
23
|
+ public function uploadFile(&$files,$path,$filename)
|
|
24
|
{
|
24
|
{
|
|
25
|
$cos = config('filesystems.disks.cos');
|
25
|
$cos = config('filesystems.disks.cos');
|
|
26
|
$cosClient = new Client([
|
26
|
$cosClient = new Client([
|
|
@@ -34,7 +34,7 @@ class CosService |
|
@@ -34,7 +34,7 @@ class CosService |
|
34
|
$cosClient->putObject([
|
34
|
$cosClient->putObject([
|
|
35
|
'Bucket' => $cos['bucket'],
|
35
|
'Bucket' => $cos['bucket'],
|
|
36
|
'Key' => $key,
|
36
|
'Key' => $key,
|
|
37
|
- 'Body' => fopen(config('filesystems.disks.upload')['root'].$path.'/'.$filename, 'r'),
|
37
|
+ 'Body' => fopen($files->getRealPath(), 'r'),
|
|
38
|
]);
|
38
|
]);
|
|
39
|
return $key;
|
39
|
return $key;
|
|
40
|
}
|
40
|
}
|