From e7ad6e79a5b0d3f37075ab79d1272986b5c06377 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Thu, 19 Nov 2026 16:22:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=93=81=E7=89=8C=20Logo=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=90=AF=E5=8A=A8=E9=A1=B5=E5=90=89=E7=A5=A5=E7=89=A9?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E4=BC=A0=E5=8C=BA=E6=94=B9=E4=B8=BA=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- index.html | 19 ++ src/api/system/otherConfig.ts | 6 +- src/assets/style/global.less | 2 +- src/components/AppMascotState/index.vue | 4 +- src/components/CustomLeftMenu/index.vue | 5 +- src/components/top-nav/index.vue | 3 +- src/locale/en-US.ts | 11 +- src/locale/zh-CN.ts | 11 +- src/main.ts | 3 + src/utils/brandLogo.ts | 107 ++++++++ src/views/h5/admin-center/ops/ops-shared.less | 2 +- src/views/h5/customer-center/price/index.vue | 5 +- src/views/order/customs9610Order/index.vue | 3 +- src/views/site/SiteHeader.vue | 3 +- src/views/system/otherConfig/index.vue | 246 +++++++++++++++--- 15 files changed, 381 insertions(+), 49 deletions(-) diff --git a/index.html b/index.html index 0748eba..fafd3c1 100644 --- a/index.html +++ b/index.html @@ -408,6 +408,25 @@ if (sub) sub.textContent = copy.sub; if (retry) retry.textContent = copy.retry; + /* 冷启动优先用缓存吉祥物,避免等 Vue/API(与 brandLogo.ts MASCOT_CACHE_KEY 一致) */ + try { + var cachedMascot = (localStorage.getItem('oms_brand_mascot_url') || '').trim(); + var logoImg = boot.querySelector('.boot-logo'); + if ( + logoImg && + cachedMascot && + (/^https?:\/\//i.test(cachedMascot) || + cachedMascot.charAt(0) === '/' || + cachedMascot.indexOf('data:') === 0) + ) { + logoImg.src = cachedMascot; + root.style.setProperty( + '--app-mascot-bg', + 'url("' + cachedMascot.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '")', + ); + } + } catch (eMascot) {} + window.__dismissAppBoot = function () { if (!boot || boot.classList.contains('is-leaving')) return; boot.classList.add('is-leaving'); diff --git a/src/api/system/otherConfig.ts b/src/api/system/otherConfig.ts index 5081745..dc39fc9 100644 --- a/src/api/system/otherConfig.ts +++ b/src/api/system/otherConfig.ts @@ -76,14 +76,16 @@ export async function uploadPaymentReceiveQr(channel: PaymentReceiveQrChannel, f return unwrapData(res.data) } -export type BrandLogoChannel = 'portal' | 'site' +export type BrandLogoChannel = 'portal' | 'site' | 'favicon' | 'mascot' export interface BrandLogoDto { portalUrl?: string siteUrl?: string + faviconUrl?: string + mascotUrl?: string } -/** 获取品牌 Logo(系统顶栏 / 官网)可访问地址 */ +/** 获取品牌 Logo(系统顶栏 / 官网 / 标签 / 吉祥物)可访问地址 */ export async function getBrandLogo() { const res = await axiosInstance.get(omsUrl('/system/other-config/brand-logo')) return unwrapData(res.data) diff --git a/src/assets/style/global.less b/src/assets/style/global.less index 947803c..bc71e9e 100644 --- a/src/assets/style/global.less +++ b/src/assets/style/global.less @@ -51,7 +51,7 @@ body { width: 36px; height: 36px; margin: 0 auto; - background: url('/app-mascot.png') center / contain no-repeat; + background: var(--app-mascot-bg, url('/app-mascot.png')) center / contain no-repeat; filter: grayscale(1) brightness(1.08) contrast(0.92); opacity: 0.78; } diff --git a/src/components/AppMascotState/index.vue b/src/components/AppMascotState/index.vue index 7ee579d..3c0a38c 100644 --- a/src/components/AppMascotState/index.vue +++ b/src/components/AppMascotState/index.vue @@ -3,7 +3,7 @@