From 2dec060b91829ac27814c2a8f6a9d6ce7e6d7c21 Mon Sep 17 00:00:00 2001 From: chenxing Date: Fri, 9 Oct 2026 10:36:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=B6=E6=A0=8F):=20LOGO=20=E5=BE=BD?= =?UTF-8?q?=E6=A0=87=E6=97=81=E6=98=BE=E7=A4=BA=E5=B9=B3=E5=8F=B0=E6=96=87?= =?UTF-8?q?=E5=AD=97=EF=BC=88yh-logo-text=20=E9=94=AE=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=EF=BC=89=EF=BC=88LOGO=E6=96=87=E5=AD=97=E4=B8=8E=E4=B8=BB?= =?UTF-8?q?=E9=A2=98JSON=E5=8C=96=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout.vue | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/components/layout.vue b/src/components/layout.vue index eb09f88..1a87f7e 100644 --- a/src/components/layout.vue +++ b/src/components/layout.vue @@ -26,14 +26,30 @@ const readLogoUrl = () => { } logoUrl.value = v || defaultLogo; }; +// LOGO 文字(平台/学校名称,2026-10-09 LOGO 文字轮):localStorage["yh-logo-text"](同一异步补齐段写入),空=不展示。 +const logoText = ref(""); +const readLogoText = () => { + let v: string | null = null; + try { + v = localStorage.getItem("yh-logo-text"); + } catch { + v = null; + } + logoText.value = v || ""; +}; const onLogoError = () => { if (logoUrl.value !== defaultLogo) logoUrl.value = defaultLogo; }; onMounted(() => { readLogoUrl(); + readLogoText(); document.addEventListener("yh-appearance-updated", readLogoUrl); + document.addEventListener("yh-appearance-updated", readLogoText); +}); +onBeforeUnmount(() => { + document.removeEventListener("yh-appearance-updated", readLogoUrl); + document.removeEventListener("yh-appearance-updated", readLogoText); }); -onBeforeUnmount(() => document.removeEventListener("yh-appearance-updated", readLogoUrl)); const isPanel = ref(false), currPath = ref(""), @@ -191,6 +207,7 @@ function linkHomePage() {
云海 + {{ logoText }}
@@ -303,4 +320,11 @@ function linkHomePage() { .home-btn svg { display: block; } +/* LOGO 文字(平台/学校名称):贴徽标右侧,顶栏品牌色深底上白字,禁止换行挤压布局 */ +.header-container .logo-text { + font-size: 16px; + font-weight: 600; + color: #fff; + white-space: nowrap; +}