From 222fa346382d5d4983827b1670aa5b442484b9d7 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 5 Nov 2021 15:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E5=8D=B0=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/upload/storage/Cos.php | 3 +++ crmeb/crmeb/services/upload/storage/Local.php | 1 + crmeb/crmeb/services/upload/storage/Oss.php | 3 +++ crmeb/crmeb/services/upload/storage/Qiniu.php | 3 +++ 4 files changed, 10 insertions(+) diff --git a/crmeb/crmeb/services/upload/storage/Cos.php b/crmeb/crmeb/services/upload/storage/Cos.php index e3e0d6216..aad131724 100644 --- a/crmeb/crmeb/services/upload/storage/Cos.php +++ b/crmeb/crmeb/services/upload/storage/Cos.php @@ -203,6 +203,9 @@ class Cos extends BaseUpload $this->fileInfo->$key = $filePath . '?imageMogr2/thumbnail/' . $config[$width] . 'x' . $config[$height]; $this->fileInfo->$key = $this->water($this->fileInfo->$key); $data[$v] = $this->fileInfo->$key; + } else { + $this->fileInfo->$key = $this->water($this->fileInfo->$key); + $data[$v] = $this->fileInfo->$key; } } } diff --git a/crmeb/crmeb/services/upload/storage/Local.php b/crmeb/crmeb/services/upload/storage/Local.php index 0c2abc2df..378fbe6a6 100644 --- a/crmeb/crmeb/services/upload/storage/Local.php +++ b/crmeb/crmeb/services/upload/storage/Local.php @@ -222,6 +222,7 @@ class Local extends BaseUpload throw new ValidateException('缩略图生成目录生成失败,目录:' . $dir); } $filePath = $this->water($filePath); + $data = ['big' => $filePath, 'mid' => $filePath, 'small' => $filePath]; $this->fileInfo->filePathWater = $filePath; $config = $this->thumbConfig; try { diff --git a/crmeb/crmeb/services/upload/storage/Oss.php b/crmeb/crmeb/services/upload/storage/Oss.php index 13e1b80e1..df06a3543 100644 --- a/crmeb/crmeb/services/upload/storage/Oss.php +++ b/crmeb/crmeb/services/upload/storage/Oss.php @@ -203,6 +203,9 @@ class Oss extends BaseUpload $this->fileInfo->$key = $filePath . '?x-oss-process=image/resize,h_' . $config[$height] . ',w_' . $config[$width]; $this->fileInfo->$key = $this->water($this->fileInfo->$key); $data[$v] = $this->fileInfo->$key; + } else { + $this->fileInfo->$key = $this->water($this->fileInfo->$key); + $data[$v] = $this->fileInfo->$key; } } } diff --git a/crmeb/crmeb/services/upload/storage/Qiniu.php b/crmeb/crmeb/services/upload/storage/Qiniu.php index 066822647..f76564149 100644 --- a/crmeb/crmeb/services/upload/storage/Qiniu.php +++ b/crmeb/crmeb/services/upload/storage/Qiniu.php @@ -204,6 +204,9 @@ class Qiniu extends BaseUpload $this->fileInfo->$key = $filePath . '?imageView2/2/w/' . $config[$width] . '/h/' . $config[$height]; $this->fileInfo->$key = $this->water($this->fileInfo->$key); $data[$v] = $this->fileInfo->$key; + } else { + $this->fileInfo->$key = $this->water($this->fileInfo->$key); + $data[$v] = $this->fileInfo->$key; } } }