Explorar o código

后台上传ico图标

evoxwht %!s(int64=4) %!d(string=hai) anos
pai
achega
c08152c854

+ 9 - 0
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];
             $to = public_path() . array_reverse(explode('/', $post['weixin_ckeck_file']))[0];
             @copy($from, $to);
             @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'])) {
         if (isset($post['admin_port'])) {
             $res = include(config_path() . 'workerman.php');
             $res = include(config_path() . 'workerman.php');
             $old_admin_port = $res['admin']['port'];
             $old_admin_port = $res['admin']['port'];

+ 1 - 1
crmeb/app/services/system/attachment/SystemAttachmentServices.php

@@ -118,7 +118,7 @@ class SystemAttachmentServices extends BaseServices
         if ($upload_type == 0) {
         if ($upload_type == 0) {
             $upload_type = sys_config('upload_type', 1);
             $upload_type = sys_config('upload_type', 1);
         }
         }
-        if ($menuName == 'weixin_ckeck_file') {
+        if ($menuName == 'weixin_ckeck_file' || $menuName == 'ico_path') {
             $upload_type = 1;
             $upload_type = 1;
             $realName = true;
             $realName = true;
         }
         }

+ 2 - 1
crmeb/config/upload.php

@@ -15,7 +15,7 @@ return [
     //上传文件大小
     //上传文件大小
     'filesize' => 2097152,
     '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' => [
     'fileMime' => [
         'image/jpeg',
         'image/jpeg',
@@ -32,6 +32,7 @@ return [
         'application/vnd.ms-excel',
         'application/vnd.ms-excel',
         'application/vnd.ms-excel',
         'application/vnd.ms-excel',
         'text/xml',
         'text/xml',
+        'image/x-icon',
     ],
     ],
     //驱动模式
     //驱动模式
     'stores' => [
     'stores' => [