From 402c9c9ebb591abcb17693ac290bbdef6bec7117 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Wed, 11 Nov 2026 14:46:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(buyer):=20=E4=BC=98=E5=8C=96=E9=A6=96?= =?UTF-8?q?=E5=B1=8F=E7=AB=99=E7=82=B9=E5=8F=8A=E4=B8=BB=E9=A2=98=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=8E=BB=E9=87=8D=EF=BC=8C=E5=B9=B6=E5=9C=A8=E9=A1=B6?= =?UTF-8?q?=E6=A0=8F=E9=80=80=E5=87=BA=E6=97=B6=E8=81=94=E5=8A=A8=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E7=99=BB=E5=87=BA=E6=B3=A8=E9=94=80=E4=BC=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/App.vue | 23 +++------- .../indexDecorate/components/TopBar.vue | 14 ++++++- buyer/src/composables/useSiteSettings.js | 11 +++-- buyer/src/utils/theme.js | 42 ++++++++++++------- 4 files changed, 53 insertions(+), 37 deletions(-) diff --git a/buyer/src/App.vue b/buyer/src/App.vue index 2545eb118..250c9d3d0 100644 --- a/buyer/src/App.vue +++ b/buyer/src/App.vue @@ -8,8 +8,7 @@ import { onMounted } from "vue"; import { useRoute } from "vue-router"; import storage from "@/plugins/storage"; -import { getBaseSite, getThemeSetting } from "@/api/common.js"; -import { fetchAndApplyTheme } from "@/utils/theme"; +import { loadSiteSettings } from "@/composables/useSiteSettings"; import { useAppStore } from "@/stores/app"; defineOptions({ name: "App" }); @@ -49,27 +48,15 @@ function init() { }); } getSite(); - getTheme(); } function getSite() { - getBaseSite().then((res) => { - if (res.success && res.result.settingValue) { - try { - const data = JSON.parse(res.result.settingValue); - applySiteInfo(data); - } catch { - // 站点配置解析失败时使用缓存 - } + loadSiteSettings().then((data) => { + if (data) { + applySiteInfo(data); } }).catch((err) => { - console.warn('获取站点配置失败', err); - }); -} - -function getTheme() { - fetchAndApplyTheme(getThemeSetting).catch((err) => { - console.warn('获取主题配置失败', err); + console.warn("获取站点配置失败", err); }); } diff --git a/buyer/src/components/indexDecorate/components/TopBar.vue b/buyer/src/components/indexDecorate/components/TopBar.vue index e0232b20d..54f5c7920 100644 --- a/buyer/src/components/indexDecorate/components/TopBar.vue +++ b/buyer/src/components/indexDecorate/components/TopBar.vue @@ -37,6 +37,8 @@