配置化平台品牌名称

This commit is contained in:
2026-06-24 22:13:00 +08:00
parent eda109cb62
commit 61b8cc6d23
34 changed files with 139 additions and 32 deletions
+12
View File
@@ -0,0 +1,12 @@
function normalizeBrandValue(value: string | undefined, fallbackValue: string): string {
const target = String(value || fallbackValue).trim()
return target || fallbackValue
}
export const BRAND_CONFIG = {
appName: normalizeBrandValue(import.meta.env.VITE_APP_NAME, '指尖设计师'),
appNameEn: normalizeBrandValue(import.meta.env.VITE_APP_NAME_EN, 'Fingertip Designer'),
appTitle: normalizeBrandValue(import.meta.env.VITE_APP_TITLE, 'Fingertip Designer 指尖设计师'),
adminAppName: normalizeBrandValue(import.meta.env.VITE_ADMIN_APP_NAME, '指尖设计师管理台'),
appShortName: normalizeBrandValue(import.meta.env.VITE_APP_SHORT_NAME, 'YN')
}
+3
View File
@@ -5,6 +5,9 @@ import './styles/admin-mobile.css'
import './style.css'
import App from './App.vue'
import router from './router'
import { BRAND_CONFIG } from './config/brand'
document.title = BRAND_CONFIG.appTitle
/**
* Purpose: app supports main.ts by holding or executing the app page or API role.
+4 -3
View File
@@ -4,13 +4,13 @@
<button class="auth-back-button" type="button" aria-label="返回" @click="handleBackClick">
<LeftOutlined />
</button>
<strong>指尖设计师</strong>
<strong>{{ BRAND_CONFIG.appName }}</strong>
<span class="auth-topbar-spacer" aria-hidden="true"></span>
</header>
<main class="auth-page">
<section class="brand-stage" aria-label="指尖设计师">
<p class="brand-name">指尖设计师</p>
<section class="brand-stage" :aria-label="BRAND_CONFIG.appName">
<p class="brand-name">{{ BRAND_CONFIG.appName }}</p>
<p class="brand-copy">{{ activeTab === 'login' ? '登录后继续预约与收藏' : '填写信息完成账号注册' }}</p>
</section>
@@ -447,6 +447,7 @@ import { ACCOUNT_REGEX, ACCOUNT_RULE_MESSAGE, sanitizeAccountInput } from '@/uti
import { runWithGlobalLoading } from '@/utils/action-loading'
import { notifyShopThemeChanged } from '@/utils/shop-theme'
import { renderRichContent } from '@/utils/rich-content'
import { BRAND_CONFIG } from '@/config/brand'
import {
userApi,
type AvailabilityCheckResponse,
+2 -1
View File
@@ -4,6 +4,7 @@ import { useRouter } from 'vue-router'
import { LeftOutlined } from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
import { userApi, type ContactInfoVO } from '@/api/user'
import { BRAND_CONFIG } from '@/config/brand'
const router = useRouter()
const loading = ref(false)
@@ -36,7 +37,7 @@ onMounted(loadContact)
<main class="content">
<section class="hero-card">
<span>指尖设计师客服</span>
<span>{{ BRAND_CONFIG.appName }}客服</span>
<h2>帮助与客服</h2>
<p>订单、预约、售后和账号问题都可以从这里继续处理。</p>
</section>
+3 -2
View File
@@ -4,12 +4,12 @@
<button class="not-found-back" type="button" aria-label="返回" @click="handleBackClick">
<LeftOutlined />
</button>
<strong>指尖设计师</strong>
<strong>{{ BRAND_CONFIG.appName }}</strong>
<span class="not-found-topbar-spacer" aria-hidden="true"></span>
</header>
<div class="not-found-content">
<span class="not-found-kicker">指尖设计师</span>
<span class="not-found-kicker">{{ BRAND_CONFIG.appName }}</span>
<div class="error-code">404</div>
<h1>这页去做护理了</h1>
<p>您访问的页面不存在或已被删除,我们带您回到首页继续浏览作品。</p>
@@ -29,6 +29,7 @@
import { ref, onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import { LeftOutlined } from '@ant-design/icons-vue'
import { BRAND_CONFIG } from '@/config/brand'
/**
* Purpose: router supports NotFoundView.vue by holding or executing the router page or API role.
+3 -2
View File
@@ -3,7 +3,7 @@
<header class="profile-hero">
<div class="profile-topbar">
<div class="profile-title-copy">
<span class="profile-kicker">指尖设计师</span>
<span class="profile-kicker">{{ BRAND_CONFIG.appName }}</span>
<h1>个人中心</h1>
</div>
<button class="profile-icon-button" type="button" aria-label="打开设置" @click="handleSettingsClick">
@@ -19,7 +19,7 @@
</div>
<div class="welcome-copy">
<span class="welcome-label">Welcome back</span>
<h2 class="username">{{ userInfo.nickname || '指尖设计师用户' }}</h2>
<h2 class="username">{{ userInfo.nickname || `${BRAND_CONFIG.appName}用户` }}</h2>
<p class="account">{{ userInfo.account || '登录后解锁预约礼遇' }}</p>
<p v-if="userInfo.signature" class="signature">{{ userInfo.signature }}</p>
</div>
@@ -275,6 +275,7 @@ import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecor
import { DEFAULT_AVATAR } from '@/constants'
import { runWithGlobalLoading } from '@/utils/action-loading'
import { notifyShopThemeChanged } from '@/utils/shop-theme'
import { BRAND_CONFIG } from '@/config/brand'
/**
* Purpose: router supports ProfileView.vue by holding or executing the router page or API role.
+3 -2
View File
@@ -17,8 +17,8 @@
:collapsed-width="80"
>
<div class="logo">
<h1 v-if="!collapsed">指尖设计师管理台</h1>
<h1 v-else>YN</h1>
<h1 v-if="!collapsed">{{ BRAND_CONFIG.adminAppName }}</h1>
<h1 v-else>{{ BRAND_CONFIG.appShortName }}</h1>
</div>
<a-menu
:selectedKeys="selectedKeys"
@@ -232,6 +232,7 @@ import { runWithGlobalLoading } from '@/utils/action-loading'
import { notifyShopThemeChanged } from '@/utils/shop-theme'
import { useAdminViewport } from '@/composables/useAdminViewport'
import { adminNavigationItems, findAdminNavigationItemByPath, type AdminNavIconKey } from '@/config/admin-navigation'
import { BRAND_CONFIG } from '@/config/brand'
import {
getAdminCurrentShopName,
getAdminRoleLabel,
@@ -39,7 +39,7 @@
</a-select>
</a-form-item>
<a-form-item label="标题">
<a-input v-model:value="form.title" placeholder="例如:Fingertip Designer 用户协议" />
<a-input v-model:value="form.title" :placeholder="`例如:${BRAND_CONFIG.appNameEn} 用户协议`" />
</a-form-item>
<a-form-item label="版本">
<a-input v-model:value="form.version" placeholder="例如:2026-05-18" />
@@ -61,6 +61,7 @@ import { message } from 'ant-design-vue'
*/
import { adminLegalAgreementApi, type LegalAgreementAdminVO } from '@/api/admin'
import type { IdType } from '@/utils/id'
import { BRAND_CONFIG } from '@/config/brand'
/**
* Purpose: loading supports LegalAgreementsView.vue by holding or executing the loading page or API role.
+2 -1
View File
@@ -431,7 +431,7 @@
</a-form-item>
<div class="theme-preview" :style="themePreviewStyle">
<div>
<span class="theme-preview__eyebrow" :style="{ color: themePreview.primaryColor }">Fingertip Designer</span>
<span class="theme-preview__eyebrow" :style="{ color: themePreview.primaryColor }">{{ BRAND_CONFIG.appNameEn }}</span>
<strong>店铺前台预览</strong>
<p>按钮、标签和柔和渐变都会围绕主色延展。</p>
</div>
@@ -638,6 +638,7 @@ import { useAdminViewport } from '@/composables/useAdminViewport'
import AdminMobileCardList from '@/components/admin/AdminMobileCardList.vue'
import AdminMobileFab from '@/components/admin/AdminMobileFab.vue'
import AdminResponsiveModal from '@/components/admin/AdminResponsiveModal.vue'
import { BRAND_CONFIG } from '@/config/brand'
const { hasPermission, loadUserPermissions } = usePermission()
const { isMobile } = useAdminViewport()