From c08152c854e17648d10fcb7d0bf749fd8dd04af7 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 27 Oct 2021 16:32:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=B8=8A=E4=BC=A0ico?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/adminapi/controller/v1/setting/SystemConfig.php | 9 +++++++++ .../system/attachment/SystemAttachmentServices.php | 2 +- crmeb/config/upload.php | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php index 9e19ef86a..05d5d0dfe 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php @@ -292,6 +292,15 @@ class SystemConfig extends AuthController $to = public_path() . array_reverse(explode('/', $post['weixin_ckeck_file']))[0]; @copy($from, $to); } + if (isset($post['ico_path'])) { + $from = public_path() . $post['ico_path']; + $toAdmin = public_path('admin') . 'favicon.ico'; + $toHome = public_path('home') . 'favicon.ico'; + $toPublic = public_path() . 'favicon.ico'; + @copy($from, $toAdmin); + @copy($from, $toHome); + @copy($from, $toPublic); + } if (isset($post['admin_port'])) { $res = include(config_path() . 'workerman.php'); $old_admin_port = $res['admin']['port']; diff --git a/crmeb/app/services/system/attachment/SystemAttachmentServices.php b/crmeb/app/services/system/attachment/SystemAttachmentServices.php index 7b162380d..9cbb24231 100644 --- a/crmeb/app/services/system/attachment/SystemAttachmentServices.php +++ b/crmeb/app/services/system/attachment/SystemAttachmentServices.php @@ -118,7 +118,7 @@ class SystemAttachmentServices extends BaseServices if ($upload_type == 0) { $upload_type = sys_config('upload_type', 1); } - if ($menuName == 'weixin_ckeck_file') { + if ($menuName == 'weixin_ckeck_file' || $menuName == 'ico_path') { $upload_type = 1; $realName = true; } diff --git a/crmeb/config/upload.php b/crmeb/config/upload.php index bde186f38..9fd85311a 100644 --- a/crmeb/config/upload.php +++ b/crmeb/config/upload.php @@ -15,7 +15,7 @@ return [ //上传文件大小 'filesize' => 2097152, //上传文件后缀类型 - 'fileExt' => ['jpg', 'jpeg', 'png', 'gif', 'pem', 'mp3', 'wma', 'wav', 'amr', 'mp4', 'key', 'xlsx', 'xls', 'txt'], + 'fileExt' => ['jpg', 'jpeg', 'png', 'gif', 'pem', 'mp3', 'wma', 'wav', 'amr', 'mp4', 'key', 'xlsx', 'xls', 'txt', 'ico'], //上传文件类型 'fileMime' => [ 'image/jpeg', @@ -32,6 +32,7 @@ return [ 'application/vnd.ms-excel', 'application/vnd.ms-excel', 'text/xml', + 'image/x-icon', ], //驱动模式 'stores' => [