|
...
|
...
|
@@ -23,7 +23,7 @@ class CosService |
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/19 15:28
|
|
|
|
*/
|
|
|
|
public function uploadFile(&$files,$path,$filename, $binary = false,$watermarkOptions = null)
|
|
|
|
public function uploadFile(&$files,$path,$filename, $binary = false,$watermarkOptions = '')
|
|
|
|
{
|
|
|
|
$cos = config('filesystems.disks.cos');
|
|
|
|
$cosClient = new Client([
|
|
...
|
...
|
@@ -41,14 +41,13 @@ class CosService |
|
|
|
'Body' => $Body,
|
|
|
|
];
|
|
|
|
//水印
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($watermarkOptions, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
if ($watermarkOptions) {
|
|
|
|
$options['PicOperations'] = json_encode([
|
|
|
|
'is_pic_info' => 1,
|
|
|
|
'rules' => [
|
|
|
|
[
|
|
|
|
'fileid' => $key, // 使用相同的文件名保存
|
|
|
|
'rule' => 'watermark/2/'.implode('/',$watermarkOptions),
|
|
|
|
'rule' => $watermarkOptions,
|
|
|
|
]
|
|
|
|
]
|
|
|
|
], true);
|
...
|
...
|
|