From 4434f9552a278b9f94dcfccd5f85245d2b4230df Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Thu, 19 Nov 2026 16:03:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=93=81=E7=89=8C=20Logo=20=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=B9=B6=E5=8A=A0=E5=9B=BA=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E7=99=BB=E5=BD=95=E8=BF=9B=E7=B3=BB=E7=BB=9F=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 其他配置支持上传系统顶栏/官网 Logo;登录成功后进系统增加超时与整页兜底,避免 Vite 热更新下卡在登录页。 Co-authored-by: Cursor --- src/api/system/otherConfig.ts | 24 ++++ src/components/top-nav/index.vue | 10 +- src/locale/en-US.ts | 11 ++ src/locale/zh-CN.ts | 11 ++ src/utils/brandLogo.ts | 51 +++++++ src/utils/enter-system.ts | 110 ++++++++++++--- .../login/components/pwd-login/index.vue | 10 +- src/views/site/SiteHeader.vue | 7 +- src/views/system/otherConfig/index.vue | 127 ++++++++++++++++++ 9 files changed, 338 insertions(+), 23 deletions(-) create mode 100644 src/utils/brandLogo.ts diff --git a/src/api/system/otherConfig.ts b/src/api/system/otherConfig.ts index 41b8161..5081745 100644 --- a/src/api/system/otherConfig.ts +++ b/src/api/system/otherConfig.ts @@ -76,6 +76,30 @@ export async function uploadPaymentReceiveQr(channel: PaymentReceiveQrChannel, f return unwrapData(res.data) } +export type BrandLogoChannel = 'portal' | 'site' + +export interface BrandLogoDto { + portalUrl?: string + siteUrl?: string +} + +/** 获取品牌 Logo(系统顶栏 / 官网)可访问地址 */ +export async function getBrandLogo() { + const res = await axiosInstance.get(omsUrl('/system/other-config/brand-logo')) + return unwrapData(res.data) +} + +/** 上传并替换品牌 Logo */ +export async function uploadBrandLogo(channel: BrandLogoChannel, file: File) { + const form = new FormData() + form.append('channel', channel) + form.append('file', file) + const res = await axiosInstance.post(omsUrl('/system/other-config/brand-logo/upload'), form, { + headers: { 'Content-Type': 'multipart/form-data' }, + }) + return unwrapData(res.data) +} + /** 轨迹服务默认配置编码 */ export const TRACK_SERVICE_CONFIG_CODE = 'track_service' diff --git a/src/components/top-nav/index.vue b/src/components/top-nav/index.vue index a684f25..9b7a509 100644 --- a/src/components/top-nav/index.vue +++ b/src/components/top-nav/index.vue @@ -3,7 +3,7 @@