From 08b697556b02947a124d4b11e2e5e1419b39b1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 15 Jul 2026 12:00:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(cms):=20=E6=9B=B4=E6=96=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=90=8D=E7=A7=B0=E5=B9=B6=E4=BC=98=E5=8C=96=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将系统名称由“小程序开发”修改为“小程序商城” - 修改多处组件中系统名称的引用,统一使用系统信息对象 - 调整快捷入口路由,更新优惠券和会员管理的跳转路径 - 使用 tenantStore 替代原有的接口调用,统一获取租户公司信息 - 优化租户创建时间的计算方式,直接从 store 获取数据 - 移除不再使用的 getTenantInfo 方法,改为通过 pinia 状态管理获取 - 调整部分模板数据绑定,修正创建时间显示逻辑 --- src/i18n/lang/zh_CN/layout.ts | 2 +- src/views/cms/cmsStatistics/index.vue | 2 +- src/views/cms/dashboard/index.vue | 2 +- src/views/shop/dashboard/index.vue | 33 ++++++++++++--------------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/i18n/lang/zh_CN/layout.ts b/src/i18n/lang/zh_CN/layout.ts index 623c3bc..124434f 100644 --- a/src/i18n/lang/zh_CN/layout.ts +++ b/src/i18n/lang/zh_CN/layout.ts @@ -1,7 +1,7 @@ const storeName = localStorage.getItem('StoreName') || 'WebSoft Inc'; /* 主框架 */ export default { - system: '小程序开发', + system: '小程序商城', home: '主页', header: { profile: '个人资料', diff --git a/src/views/cms/cmsStatistics/index.vue b/src/views/cms/cmsStatistics/index.vue index 00eba76..bf79e1e 100644 --- a/src/views/cms/cmsStatistics/index.vue +++ b/src/views/cms/cmsStatistics/index.vue @@ -87,7 +87,7 @@ // 系统信息 const systemInfo = ref({ - name: '小程序开发', + name: '小程序商城', description: '基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台', version: '2.0.0', diff --git a/src/views/cms/dashboard/index.vue b/src/views/cms/dashboard/index.vue index 8562bb8..2ac6584 100644 --- a/src/views/cms/dashboard/index.vue +++ b/src/views/cms/dashboard/index.vue @@ -228,7 +228,7 @@ // 系统信息 const systemInfo = ref({ - name: '小程序开发', + name: '小程序商城', description: '基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台', version: '2.0.0', diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue index 7cdaa99..79ca4da 100644 --- a/src/views/shop/dashboard/index.vue +++ b/src/views/shop/dashboard/index.vue @@ -147,7 +147,7 @@
- {{ siteStore.appName }} + {{ systemInfo.name }} {{ systemInfo.version }} @@ -156,7 +156,7 @@ {{ siteStore.statusText || '正常' }} - {{ siteInfo?.createTime }} + {{ tenantStore.company?.createTime || '-' }} {{ siteInfo?.expirationTime }} @@ -193,11 +193,11 @@ 商品分类 - + 优惠券管理 - + 会员管理 @@ -237,8 +237,8 @@ import { message } from 'ant-design-vue/es'; import { useSiteStore } from '@/store/modules/site'; import { useStatisticsStore } from '@/store/modules/statistics'; import { useUserStore } from '@/store/modules/user'; +import { useTenantStore } from '@/store/modules/tenant'; import { pageShopOrder } from '@/api/shop/shopOrder'; -import { getTenantInfo } from '@/api/layout'; import { storeToRefs } from 'pinia'; import { removeSiteInfoCache } from '@/api/cms/cmsWebsite'; @@ -246,6 +246,7 @@ import { removeSiteInfoCache } from '@/api/cms/cmsWebsite'; const siteStore = useSiteStore(); const statisticsStore = useStatisticsStore(); const userStore = useUserStore(); +const tenantStore = useTenantStore(); const router = useRouter(); // 从 store 中获取响应式数据 @@ -263,11 +264,11 @@ const systemInfo = reactive({ // 计算属性 const now = ref(Date.now()); -const tenantCreateTime = ref(''); let runDaysTimer: ReturnType; const runDays = computed(() => { - if (!tenantCreateTime.value) return 0; - return Math.floor((now.value - new Date(tenantCreateTime.value).getTime()) / (24 * 60 * 60 * 1000)); + const createTime = tenantStore.company?.createTime; + if (!createTime) return 0; + return Math.floor((now.value - new Date(createTime).getTime()) / (24 * 60 * 60 * 1000)); }); const userCount = computed(() => statisticsStore.userCount); const orderCount = computed(() => statisticsStore.orderCount); @@ -311,11 +312,11 @@ const todayStats = computed(() => ({ // 快速入口 const quickLinks = [ - { to: '/shop/shopOrder', icon: '📦', label: '订单管理', bg: '#f0fdf4' }, + { to: '/shop/shopOrder?tab=all', icon: '📦', label: '订单管理', bg: '#f0fdf4' }, { to: '/shop/shopGoods', icon: '🏸', label: '商品管理', bg: '#ecfdf5' }, { to: '/shop/shopGoodsCategory', icon: '🗂️', label: '商品分类', bg: '#eff6ff' }, - { to: '/shop/shopCoupon', icon: '🎁', label: '优惠券', bg: '#fff7ed' }, - { to: '/shop/shopUser', icon: '👥', label: '会员管理', bg: '#faf5ff' }, + { to: '/market/coupon', icon: '🎁', label: '优惠券', bg: '#fff7ed' }, + { to: '/system/user', icon: '👥', label: '会员管理', bg: '#faf5ff' }, { to: '/shop/shopSetting', icon: '⚙️', label: '商城设置', bg: '#fefce8' }, ]; @@ -362,13 +363,9 @@ const refreshStatistics = async () => { // 加载数据 const loadData = async () => { // 独立请求租户信息,不受其他请求失败影响 - getTenantInfo() - .then((res) => { - tenantCreateTime.value = res?.createTime || ''; - }) - .catch((e) => { - console.warn('获取租户信息失败:', e); - }); + tenantStore.fetchTenantInfo().catch((e) => { + console.warn('获取租户信息失败:', e); + }); try { await Promise.all([