mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
增加缩略图开关
This commit is contained in:
parent
0e91ad7340
commit
47f1bf25a1
@ -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' => [
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user