diff --git a/frontend/src/components/PkgLogo.vue b/frontend/src/components/PkgLogo.vue index 4c896d9..be9fc69 100644 --- a/frontend/src/components/PkgLogo.vue +++ b/frontend/src/components/PkgLogo.vue @@ -27,12 +27,21 @@ const style = computed(() => { } }) -// favicon 来源:主页域名根路径 /favicon.ico(不依赖第三方服务,站点没有时回退徽标) +// favicon 来源: +// - GitHub 仓库主页 → 组织/用户头像 {owner}.png(GitHub 全站 favicon 是章鱼猫无区分度,头像才是该项目的 logo) +// - 其他主页 → 域名根路径 /favicon.ico +// 加载失败一律回退首字母徽标 const imgOk = ref(false) const faviconUrl = computed(() => { - if (!props.homepage) return '' + const hp = props.homepage + if (!hp) return '' try { - return new URL(props.homepage).origin + '/favicon.ico' + const u = new URL(hp) + if (u.hostname === 'github.com' || u.hostname === 'www.github.com') { + const m = hp.match(/^https?:\/\/(?:www\.)?github\.com\/([^/?#]+)\/[^/?#]+/) + if (m) return `https://github.com/${m[1]}.png` + } + return u.origin + '/favicon.ico' } catch { return '' } diff --git a/verdaccio-cache-manager-amd64.tar b/verdaccio-cache-manager-amd64.tar index 444797a..5353c8e 100644 Binary files a/verdaccio-cache-manager-amd64.tar and b/verdaccio-cache-manager-amd64.tar differ