From e7a326e9d7316734bc495647094275458e8000d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 1 Mar 2022 20:35:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=8D=87=E7=BA=A7=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E5=9B=BE=E6=A0=87=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Config.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 24ed082ed..fb36b2617 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -87,16 +87,7 @@ class Config extends Controller } // 修改网站 ICON 图标文件,替换 public/favicon.ico 文件 if (preg_match('#^https?://#', $icon = $post['site_icon'] ?? '')) try { - if (preg_match('#/upload/(\w{2}/\w{30}.\w+)$#', $icon, $vars)) { - $info = LocalStorage::instance()->info($vars[1]); - } - if (empty($info) || empty($info['file'])) { - $info = LocalStorage::down($icon); - } - if (!empty($info) && !empty($info['file'])) { - $favicon = new FaviconExtend($info['file'], [48, 48]); - $favicon->saveIco("{$this->app->getRootPath()}public/favicon.ico"); - } + SystemService::instance()->setFavicon($icon); } catch (\Exception $exception) { trace_file($exception); $this->error($exception->getMessage());