feat(cms): 更新系统名称并优化租户信息获取逻辑

- 将系统名称由“小程序开发”修改为“小程序商城”
- 修改多处组件中系统名称的引用,统一使用系统信息对象
- 调整快捷入口路由,更新优惠券和会员管理的跳转路径
- 使用 tenantStore 替代原有的接口调用,统一获取租户公司信息
- 优化租户创建时间的计算方式,直接从 store 获取数据
- 移除不再使用的 getTenantInfo 方法,改为通过 pinia 状态管理获取
- 调整部分模板数据绑定,修正创建时间显示逻辑
This commit is contained in:
2026-07-15 12:00:14 +08:00
parent b0ff82599a
commit 08b697556b
4 changed files with 18 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
const storeName = localStorage.getItem('StoreName') || 'WebSoft Inc';
/* 主框架 */
export default {
system: '小程序开发',
system: '小程序商城',
home: '主页',
header: {
profile: '个人资料',

View File

@@ -87,7 +87,7 @@
// 系统信息
const systemInfo = ref({
name: '小程序开发',
name: '小程序商城',
description:
'基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
version: '2.0.0',

View File

@@ -228,7 +228,7 @@
// 系统信息
const systemInfo = ref({
name: '小程序开发',
name: '小程序商城',
description:
'基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
version: '2.0.0',

View File

@@ -147,7 +147,7 @@
<div style="padding: 16px 18px;">
<a-descriptions :column="1" size="small">
<a-descriptions-item label="系统名称">
{{ siteStore.appName }}
{{ systemInfo.name }}
</a-descriptions-item>
<a-descriptions-item label="版本号">
{{ systemInfo.version }}
@@ -156,7 +156,7 @@
{{ siteStore.statusText || '正常' }}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{ siteInfo?.createTime }}
{{ tenantStore.company?.createTime || '-' }}
</a-descriptions-item>
<a-descriptions-item label="到期时间">
{{ siteInfo?.expirationTime }}
@@ -193,11 +193,11 @@
<AppstoreOutlined />
商品分类
</a-button>
<a-button block @click="navigateTo('/shop/shopCoupon')">
<a-button block @click="navigateTo('/market/coupon')">
<GiftOutlined />
优惠券管理
</a-button>
<a-button block @click="navigateTo('/shop/shopUser')">
<a-button block @click="navigateTo('/system/user')">
<TeamOutlined />
会员管理
</a-button>
@@ -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<string>('');
let runDaysTimer: ReturnType<typeof setInterval>;
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([