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());