diff --git a/src/components/layout.vue b/src/components/layout.vue index cb8be74..4f3c39b 100644 --- a/src/components/layout.vue +++ b/src/components/layout.vue @@ -21,14 +21,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); const currPath = ref(""); @@ -190,6 +206,7 @@ function linkHomePage() {
云海 + {{ logoText }}
@@ -308,4 +325,11 @@ function linkHomePage() { position: static; top: 0; } +/* LOGO 文字(平台/学校名称):贴徽标右侧,顶栏品牌色深底上白字,禁止换行挤压布局 */ +.header-container .logo-text { + font-size: 16px; + font-weight: 600; + color: #fff; + white-space: nowrap; +} \ No newline at end of file