evoxwht 4 лет назад
Родитель
Сommit
47f1bf25a1

+ 11 - 0
crmeb/app/services/system/config/SystemConfigServices.php

@@ -177,6 +177,17 @@ class SystemConfigServices extends BaseServices
             ],
             'show_value' => 1
         ],
+        'image_thumbnail_status' => [
+            'son_type' => [
+                'thumb_big_width' => '',
+                'thumb_big_height' => '',
+                'thumb_mid_width' => '',
+                'thumb_mid_height' => '',
+                'thumb_small_width' => '',
+                'thumb_small_height' => '',
+            ],
+            'show_value' => 1
+        ],
         'image_watermark_status' => [
             'son_type' => [
                 'watermark_type' => [

+ 1 - 1
crmeb/crmeb/services/upload/storage/Cos.php

@@ -199,7 +199,7 @@ class Cos extends BaseUpload
                     $height = 'thumb_' . $v . '_height';
                     $width = 'thumb_' . $v . '_width';
                     $key = 'filePath' . ucfirst($v);
-                    if (isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
+                    if (sys_config('image_thumbnail_status', 1) && isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
                         $this->fileInfo->$key = $filePath . '?imageMogr2/thumbnail/' . $config[$width] . 'x' . $config[$height];
                         $this->fileInfo->$key = $this->water($this->fileInfo->$key);
                         $data[$v] = $this->fileInfo->$key;

+ 1 - 1
crmeb/crmeb/services/upload/storage/Local.php

@@ -139,7 +139,7 @@ class Local extends BaseUpload
         $this->fileInfo->realName = $fileHandle->getOriginalName();
         $this->fileInfo->fileName = $this->fileInfo->uploadInfo->getFilename();
         $this->fileInfo->filePath = $this->defaultPath . '/' . str_replace('\\', '/', $fileName);
-        if ($this->checkImage(public_path() . $this->fileInfo->filePath) && $this->authThumb) {
+        if ($this->checkImage(public_path() . $this->fileInfo->filePath) && $this->authThumb && pathinfo($fileName,PATHINFO_EXTENSION) != 'ico') {
             try {
                 $this->thumb($this->fileInfo->filePath);
             } catch (\Throwable $e) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Oss.php

@@ -199,7 +199,7 @@ class Oss extends BaseUpload
                     $height = 'thumb_' . $v . '_height';
                     $width = 'thumb_' . $v . '_width';
                     $key = 'filePath' . ucfirst($v);
-                    if (isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
+                    if (sys_config('image_thumbnail_status', 1) && isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
                         $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;

+ 1 - 1
crmeb/crmeb/services/upload/storage/Qiniu.php

@@ -200,7 +200,7 @@ class Qiniu extends BaseUpload
                     $height = 'thumb_' . $v . '_height';
                     $width = 'thumb_' . $v . '_width';
                     $key = 'filePath' . ucfirst($v);
-                    if (isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
+                    if (sys_config('image_thumbnail_status', 1) && isset($config[$height]) && isset($config[$width]) && $config[$height] && $config[$width]) {
                         $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;