feat(顶栏): LOGO 徽标旁显示平台文字(yh-logo-text 键接入)(LOGO文字与主题JSON化)
build / build (push) Successful in 3m13s

This commit is contained in:
chenxing
2026-10-09 10:36:10 +08:00
parent c12628f051
commit 2dec060b91
+25 -1
View File
@@ -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<string>(""),
@@ -191,6 +207,7 @@ function linkHomePage() {
<header class="header-container fix">
<!-- 云海 logo 徽标(结构与 Notice layout 对齐,皮肤见通道 base.layout.css .logo-badge) -->
<span class="logo-badge fl"><img :src="logoUrl" alt="云海" @error="onLogoError" /></span>
<span v-if="logoText" class="logo-text">{{ logoText }}</span>
<div class="fl align-middle icon-box">
<div title="首页" class="icon-btn home-btn" @click="linkHomePage">
<SvgIcon name="shouye" :size="22" color="#fff" />
@@ -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;
}
</style>