diff --git a/index.html b/index.html index fafd3c1..bce0cbe 100644 --- a/index.html +++ b/index.html @@ -108,8 +108,6 @@ } })(); - - +
@@ -412,14 +432,35 @@ try { var cachedMascot = (localStorage.getItem('oms_brand_mascot_url') || '').trim(); var logoImg = boot.querySelector('.boot-logo'); - if ( + var logoText = boot.querySelector('.boot-text-logo'); + var isLegacyDefault = + !cachedMascot || + cachedMascot === '/app-mascot.png' || + cachedMascot.indexOf('/app-mascot.png?') === 0 || + cachedMascot.indexOf('app-mascot.png') >= 0 || + cachedMascot === '/empty-placeholder.svg' || + cachedMascot.indexOf('/empty-placeholder.svg') === 0; + if (isLegacyDefault) { + try { + localStorage.removeItem('oms_brand_mascot_url'); + } catch (eClear) {} + root.classList.remove('has-app-mascot'); + root.style.removeProperty('--app-mascot-bg'); + if (logoImg) { + logoImg.hidden = true; + logoImg.removeAttribute('src'); + } + if (logoText) logoText.removeAttribute('hidden'); + } else if ( logoImg && - cachedMascot && (/^https?:\/\//i.test(cachedMascot) || cachedMascot.charAt(0) === '/' || cachedMascot.indexOf('data:') === 0) ) { + logoImg.hidden = false; logoImg.src = cachedMascot; + if (logoText) logoText.setAttribute('hidden', ''); + root.classList.add('has-app-mascot'); root.style.setProperty( '--app-mascot-bg', 'url("' + cachedMascot.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '")', diff --git a/nginx-k3s.conf b/nginx-k3s.conf index 64837cf..a62addc 100644 --- a/nginx-k3s.conf +++ b/nginx-k3s.conf @@ -36,7 +36,7 @@ server { } location = /favicon.ico { - try_files /favicon.png /favicon.ico =404; + try_files /favicon.ico =404; expires 7d; add_header Cache-Control "public"; access_log off; diff --git a/public/app-mascot.png b/public/app-mascot.png deleted file mode 100644 index a5ba78c..0000000 Binary files a/public/app-mascot.png and /dev/null differ diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 3f851af..0000000 Binary files a/public/favicon.png and /dev/null differ diff --git a/public/site/img/logo1.png b/public/site/img/logo1.png deleted file mode 100644 index 3f851af..0000000 Binary files a/public/site/img/logo1.png and /dev/null differ diff --git a/scripts/postbuild-cleanup-dist.js b/scripts/postbuild-cleanup-dist.js index d7ddf43..68f4e05 100644 --- a/scripts/postbuild-cleanup-dist.js +++ b/scripts/postbuild-cleanup-dist.js @@ -10,9 +10,3 @@ if (fs.existsSync(legacyLoginDir)) { fs.rmSync(legacyLoginDir, { recursive: true, force: true }); console.log('[postbuild] removed dist/login (conflicts with SPA route /login)'); } - -const faviconSrc = path.join(dist, 'site', 'img', 'logo1.png'); -if (fs.existsSync(faviconSrc)) { - fs.copyFileSync(faviconSrc, path.join(dist, 'favicon.png')); - console.log('[postbuild] copied favicon.png from site logo'); -} diff --git a/src/api/system/otherConfig.ts b/src/api/system/otherConfig.ts index dc39fc9..41b0c2e 100644 --- a/src/api/system/otherConfig.ts +++ b/src/api/system/otherConfig.ts @@ -76,6 +76,14 @@ export async function uploadPaymentReceiveQr(channel: PaymentReceiveQrChannel, f return unwrapData(res.data) } +/** 清除指定渠道充值收款码 */ +export async function clearPaymentReceiveQr(channel: PaymentReceiveQrChannel) { + const res = await axiosInstance.post( + omsUrl(`/system/other-config/payment-qr/clear?channel=${encodeURIComponent(channel)}`), + ) + return unwrapData(res.data) +} + export type BrandLogoChannel = 'portal' | 'site' | 'favicon' | 'mascot' export interface BrandLogoDto { @@ -102,6 +110,14 @@ export async function uploadBrandLogo(channel: BrandLogoChannel, file: File) { return unwrapData(res.data) } +/** 清除指定渠道品牌 Logo(前端回退文字 LOGO) */ +export async function clearBrandLogo(channel: BrandLogoChannel) { + const res = await axiosInstance.post( + omsUrl(`/system/other-config/brand-logo/clear?channel=${encodeURIComponent(channel)}`), + ) + return unwrapData(res.data) +} + /** 轨迹服务默认配置编码 */ export const TRACK_SERVICE_CONFIG_CODE = 'track_service' diff --git a/src/assets/500x500.png b/src/assets/500x500.png deleted file mode 100644 index b3d579a..0000000 Binary files a/src/assets/500x500.png and /dev/null differ diff --git a/src/assets/images/app-mascot.png b/src/assets/images/app-mascot.png deleted file mode 100644 index a5ba78c..0000000 Binary files a/src/assets/images/app-mascot.png and /dev/null differ diff --git a/src/assets/style/global.less b/src/assets/style/global.less index bc71e9e..c5c8cd5 100644 --- a/src/assets/style/global.less +++ b/src/assets/style/global.less @@ -39,24 +39,34 @@ body { -moz-osx-font-smoothing: grayscale; } -/* 全局空态:用吉祥物替换 Arco Empty 默认图标 */ +/* 全局空态:未配置吉祥物显示文字 LOGO;有配置用图片 */ .arco-empty-image { .arco-icon { display: none !important; } &::after { - content: ''; + content: 'LOGO'; display: block; - width: 36px; - height: 36px; margin: 0 auto; - 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; + font-size: 18px; + font-weight: 700; + letter-spacing: 0.08em; + line-height: 1; + color: var(--color-text-3, #86909c); + opacity: 0.55; } } +html.has-app-mascot .arco-empty-image::after { + content: ''; + width: 36px; + height: 36px; + background: var(--app-mascot-bg) center / contain no-repeat; + filter: grayscale(1) brightness(1.08) contrast(0.92); + opacity: 0.78; +} + .arco-empty-image img { max-height: 44px; width: auto; diff --git a/src/components/AppMascotState/index.vue b/src/components/AppMascotState/index.vue index 3c0a38c..26b194f 100644 --- a/src/components/AppMascotState/index.vue +++ b/src/components/AppMascotState/index.vue @@ -1,6 +1,7 @@