feat(web): 接入品牌 Favicon,并修好一直 404 的图标链接

nuxt.config.ts 早已声明 /favicon.ico,但 public/ 下并无该文件,
该请求一直 404(配置写了、文件没放)。

- public/ 新增 favicon.svg(内嵌 256px PNG,高分屏清晰)、favicon.ico
  (16/32/48/64 四尺寸打包)、apple-touch-icon.png、icon-192.png
- link 里把 SVG 排到 .ico 之前:浏览器取第一个能用的,SVG 更清晰,.ico 兜底旧版
- .gitignore 忽略 .codegraph/(本地索引)与 hjc-web.zip
  (项目快照包,内含被排除的 .env,入库会把配置写进历史)
This commit is contained in:
2026-10-09 10:20:11 +08:00
parent 1b3e020800
commit 0f1a6144c0
6 changed files with 14 additions and 0 deletions
+7
View File
@@ -9,3 +9,10 @@ dist
.env .env
.env.local .env.local
.env.*.local .env.*.local
# 项目快照压缩包:本地打包产物,且内含上面这些被排除的 .env,
# 一旦提交会把配置写进 git 历史,事后很难清除。
hjc-web.zip
# CodeGraph 本地索引,机器相关,不入库
.codegraph/
+3
View File
@@ -79,7 +79,10 @@ export default defineNuxtConfig({
{ name: 'robots', content: 'index,follow' } { name: 'robots', content: 'index,follow' }
], ],
link: [ link: [
// 图标优先级:SVG 在前,浏览器取第一个能用的;.ico 兜底旧版浏览器
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
// 提前与接口/图片源站建立连接,降低首字节与图片加载延迟 // 提前与接口/图片源站建立连接,降低首字节与图片加载延迟
{ rel: 'preconnect', href: 'https://api.gxhuijicai.com', crossorigin: '' }, { rel: 'preconnect', href: 'https://api.gxhuijicai.com', crossorigin: '' },
{ rel: 'dns-prefetch', href: 'https://api.gxhuijicai.com' }, { rel: 'dns-prefetch', href: 'https://api.gxhuijicai.com' },
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB