修改后台ico文件展示

This commit is contained in:
Anyon 2022-03-01 18:40:12 +08:00
parent 4b8e12919c
commit 7ea65bbf0c
5 changed files with 6 additions and 5 deletions

View File

@ -94,11 +94,12 @@ class Config extends Controller
$info = LocalStorage::down($icon);
}
if (!empty($info) && !empty($info['file'])) {
$favicon = new FaviconExtend($info['file'], [256, 256]);
$favicon = new FaviconExtend($info['file'], [48, 48]);
$favicon->saveIco("{$this->app->getRootPath()}public/favicon.ico");
}
} catch (\Exception $exception) {
trace_file($exception);
$this->error($exception->getMessage());
}
// 数据数据到系统配置表
foreach ($post as $k => $v) sysconf($k, $v);

View File

@ -42,9 +42,11 @@
<div class="help-label label-required-prev"><b>浏览器小图标</b>Browser Icon</div>
<label class="relative block label-required-null">
<input class="layui-input" required pattern="^(http|/)" placeholder="请上传浏览器图标" value="{:sysconf('site_icon')}" name="site_icon">
<a class="input-right-icon layui-icon layui-icon-upload-drag" data-file="btn" data-type="ico,png,jpg" data-field="site_icon"></a>
<a class="input-right-icon layui-icon layui-icon-upload-drag" data-file="btn" data-type="png,jpg,jpeg" data-field="site_icon"></a>
</label>
<span class="help-block">建议上传 <span class="color-blue">128x128</span> | <span class="color-blue">256x256</span> ico png 图片,可以通过 <a href="https://www.favicon-icon-generator.com" target="_blank">ICON </a>在线制作 ico 后缀文件 ~</span>
<div class="help-block sub-span-blue">
建议上传 <span>128x128</span> <span>256x256</span> <span>JPG</span>,<span>PNG</span>,<span>JPEG</span> 图片,保存后会自动生成 <span>48x48</span> <span>ICO</span> 文件 ~
</div>
</div>
<div class="layui-row layui-col-space15 margin-bottom-5">

View File

@ -9,7 +9,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=0.4">
<link rel="shortcut icon" href="{:sysconf('site_icon')}">
<link rel="stylesheet" href="__ROOT__/static/plugs/layui/css/layui.css?at={:date('md')}">
<link rel="stylesheet" href="__ROOT__/static/theme/css/iconfont.css?at={:date('md')}">
<link rel="stylesheet" href="__ROOT__/static/theme/css/console.css?at={:date('md')}">

View File

@ -10,7 +10,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=0.4">
<link rel="shortcut icon" href="{:sysconf('site_icon')}">
<link rel="stylesheet" href="__ROOT__/static/plugs/layui/css/layui.css?at={:date('md')}">
<link rel="stylesheet" href="__ROOT__/static/theme/css/iconfont.css?at={:date('md')}">
<link rel="stylesheet" href="__ROOT__/static/theme/css/console.css?at={:date('md')}">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB