Merge pull request 'Dev' (#101) from dev into sit
自动发布测试环境 Nacos 配置 / publish (push) Successful in 20s

Reviewed-on: #101
This commit was merged in pull request #101.
This commit is contained in:
2026-11-05 17:17:44 +08:00
18 changed files with 254 additions and 224 deletions
@@ -36,6 +36,10 @@ public class AgreementAcceptanceInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 后台管理端不参与协议版本校验:平台管理人员登录后台即视为已知悉协议,不产生同意记录、不弹更新提示。
if (isAdminRequestPath(request.getRequestURI())) {
return true;
}
Object userIdAttribute = request.getAttribute("userId");
if (!(userIdAttribute instanceof Number)) {
return true;
@@ -62,6 +66,16 @@ public class AgreementAcceptanceInterceptor implements HandlerInterceptor {
}
}
/**
* 判断请求是否属于后台管理端。
* 网关会把 {@code /api/admin/**} 与 {@code /admin/api/**} 统一改写为 {@code /admin/**} 转发到 Core;
* 另有部分管理端接口以业务前缀 + {@code /admin/**} 暴露(如 {@code /order/admin/**})。
* 因此只要路径包含 {@code /admin/} 段即视为管理端请求,直接放行。
*/
private boolean isAdminRequestPath(String path) {
return path != null && path.contains("/admin/");
}
private void writeAgreementRequired(HttpServletResponse response,
Map<String, String> currentVersions,
List<String> pendingTypes) throws Exception {
@@ -0,0 +1,28 @@
-- 协议补充后台管理端豁免说明:仅为澄清性文字补充,不新增协议版本、不改变版本号与生效日期。
-- 背景:后台管理端已豁免协议版本校验,协议正文需同步说明后台管理端不适用重新确认流程。
-- 幂等:REPLACE 的匹配串以句号结尾,替换后原句号变为分号,重复执行不会再次匹配或二次拼接。
-- 注意:V17/V18/V19/V20 已执行,不得修改;本文件只更新当前生效版本(status = 1)的正文。
UPDATE t_legal_agreement
SET content = REPLACE(
content,
'协议发生重要变更时,我们会通过小程序提示并重新征得同意。',
'协议发生重要变更时,我们会通过小程序提示并重新征得同意;后台管理端(运营管理后台)不适用重新确认流程,平台运营人员登录后台即视为已知悉当前版本。'
),
update_time = NOW()
WHERE agreement_type = 'USER_TERMS'
AND status = 1
AND is_delete = 0
AND content LIKE '%协议发生重要变更时,我们会通过小程序提示并重新征得同意。%';
UPDATE t_legal_agreement
SET content = REPLACE(
content,
'处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知。',
'处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知;后台管理端(运营管理后台)不适用重新确认流程。'
),
update_time = NOW()
WHERE agreement_type = 'PRIVACY_POLICY'
AND status = 1
AND is_delete = 0
AND content LIKE '%处理目的、信息类别或第三方范围发生重要变化时,我们会更新版本并通过小程序提示、公告或重新征得同意等方式告知。%';
@@ -17,6 +17,7 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
@@ -76,6 +77,33 @@ class AgreementAcceptanceInterceptorTest {
assertTrue(interceptor.preHandle(authenticatedRequest(9L), new MockHttpServletResponse(), new Object()));
}
@Test
void allowsAdminPathWithoutAgreementCheck() throws Exception {
MockHttpServletRequest request = authenticatedRequest(9L);
request.setRequestURI("/admin/dashboard/overview");
assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object()));
verifyNoInteractions(agreementVersionCacheService);
}
@Test
void allowsLegacyAdminApiPrefixWithoutAgreementCheck() throws Exception {
MockHttpServletRequest request = authenticatedRequest(9L);
request.setRequestURI("/admin/api/dashboard/overview");
assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object()));
verifyNoInteractions(agreementVersionCacheService);
}
@Test
void allowsBusinessPrefixedAdminPathWithoutAgreementCheck() throws Exception {
MockHttpServletRequest request = authenticatedRequest(9L);
request.setRequestURI("/order/admin/list");
assertTrue(interceptor.preHandle(request, new MockHttpServletResponse(), new Object()));
verifyNoInteractions(agreementVersionCacheService);
}
private MockHttpServletRequest authenticatedRequest(Long userId) {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setAttribute("userId", userId);
@@ -72,7 +72,7 @@
<h2>十、跨境传输</h2>
<p>目前我们不涉及向境外提供个人信息。如未来因业务需要发生跨境传输,我们将另行告知处理目的、接收方和联系方式,并依法取得单独同意或完成安全评估、备案等程序。</p>
<h2>十一、政策更新与联系</h2>
<p>处理目的、数据类别或服务商发生重要变化时,我们会更新本政策并在需要时重新征求同意。用户可以在账号设置查看当前版本、注销申请状态、撤回待处理申请并提交隐私相关请求;也可联系所属门店管理员。</p>
<p>处理目的、数据类别或服务商发生重要变化时,我们会更新本政策并在需要时重新征求同意;后台管理端(运营管理后台)不适用重新确认流程。用户可以在账号设置查看当前版本、注销申请状态、撤回待处理申请并提交隐私相关请求;也可联系所属门店管理员。</p>
<p>本文件是产品说明,不构成法律意见;上线前应由运营方或专业顾问结合实际处理活动审阅。</p>
</div>
</main>
@@ -33,7 +33,7 @@
<div id="legal-content">
<p class="note">本服务面向经门店授权的店长和员工,提供门店日程、预约、客户业务资料和经营记录管理。预约金额是业务记录,不表示本平台已收款;当前不提供充值、订阅或平台虚拟权益购买。</p>
<h2>一、协议接受与版本</h2>
<p>使用前请阅读本协议及《隐私政策》。登录时须主动选择同意;未同意时不会交换微信登录凭证,也不能继续使用。本协议版本为 2026.11.04,自 2026 年 11 月 4 日起生效;协议更新后需重新确认。</p>
<p>使用前请阅读本协议及《隐私政策》。登录时须主动选择同意;未同意时不会交换微信登录凭证,也不能继续使用。本协议版本为 2026.11.04,自 2026 年 11 月 4 日起生效;协议更新后需重新确认;后台管理端(运营管理后台)不适用重新确认流程,平台运营人员登录后台即视为已知悉当前版本。</p>
<h2>二、账号与使用权限</h2>
<p>微信 OpenID 用于关联工作台账号。账号仅供本人使用,不得转借、出租或共享。昵称和头像可选;手机号可选绑定,不绑定不影响基础功能。离职或不再获授权时,门店管理员可以调整或停用账号权限。</p>
<p>手机号及手机号形式的账号按《隐私政策》所述采用加密存储和不可逆索引;常规页面展示脱敏号码,完整号码仅在必要业务场景和权限校验通过时展示。使用者不得擅自收集、导出或向无关第三方提供完整号码。</p>
+11 -7
View File
@@ -162,10 +162,10 @@ const showError = (msg: string) => {
/**
* 处理服务端 4510(未同意最新协议):
* 锁定后续业务请求、广播事件让后台布局弹出既有的同意弹层,并提示用户。
* 非后台场景没有弹层,直接新开协议阅读页,引导用户阅读后重新登录同意。
* 仅用于用户端(小程序由独立实现处理,C 端页面走这里):锁定后续业务请求、提示用户并打开协议阅读页。
* 后台管理端不做协议版本校验,不会进入该分支。
*/
const handleAgreementRequired = (res: any, isAdminRequest: boolean) => {
const handleAgreementRequired = (res: any) => {
setAgreementPending(true)
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent(AGREEMENT_REQUIRED_EVENT, { detail: res?.data || {} }))
@@ -175,7 +175,7 @@ const handleAgreementRequired = (res: any, isAdminRequest: boolean) => {
}
lastAgreementRequiredTime = Date.now()
showError(normalizeApiErrorMessage(res?.message || '用户协议与隐私政策已更新,请阅读并同意后继续使用'))
if (!isAdminRequest && typeof window !== 'undefined') {
if (typeof window !== 'undefined') {
window.open('/legal/user-terms.html', '_blank', 'noopener')
}
}
@@ -277,11 +277,12 @@ const handleTokenExpired = (isAdmin = false, failedToken: string | null = null)
api.interceptors.request.use(
async config => {
if (isAgreementPending() && !AGREEMENT_GATE_ALLOWLIST.some(path => config.url?.includes(path))) {
const isAdminRequest = isAdminScopedUrl(config.url)
// 后台管理端不做协议版本校验:既不进入未同意门禁,也不因门禁状态被拦截。
if (!isAdminRequest && isAgreementPending() && !AGREEMENT_GATE_ALLOWLIST.some(path => config.url?.includes(path))) {
return Promise.reject(new Error('请先阅读并同意最新版用户协议与隐私政策'))
}
const isAdminRequest = isAdminScopedUrl(config.url)
let token = isAdminRequest
? (localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken'))
: (localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken'))
@@ -313,7 +314,10 @@ api.interceptors.response.use(
const res = response.data
if (Number(res?.code) === AGREEMENT_VERSION_REQUIRED_CODE) {
const errorMsg = normalizeApiErrorMessage(res?.message || '用户协议与隐私政策已更新,请阅读并同意后继续使用')
handleAgreementRequired(res, isAdminScopedUrl(response.config?.url))
// 后台管理端已由服务端放行,若历史服务端仍返回 4510,也不触发门禁/提示,避免后台被锁死。
if (!isAdminScopedUrl(response.config?.url)) {
handleAgreementRequired(res)
}
return Promise.reject(new Error(errorMsg))
}
if (res.code !== 200) {
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { adminNavigationItems, findAdminNavigationItemByPath, ADMIN_DASHBOARD_PATH } from './admin-navigation'
import { adminNavigationItems, findAdminNavigationItemByPath, getAdminBreadcrumbTrail, ADMIN_DASHBOARD_PATH } from './admin-navigation'
describe('admin-navigation', () => {
it('exposes a fixed Salon management menu without permission-based filtering', () => {
@@ -7,9 +7,17 @@ describe('admin-navigation', () => {
expect(findAdminNavigationItemByPath('/admin/shops')?.label).toBe('门店管理')
expect(findAdminNavigationItemByPath('/admin/products')).toBeUndefined()
expect(adminNavigationItems[0]?.path).toBe('/admin')
expect(adminNavigationItems.map(item => item.label)).toEqual([
expect(adminNavigationItems.filter(item => !item.menuHidden).map(item => item.label)).toEqual([
'首页', '账号管理', '注册审核', '隐私与内容复核', '门店管理', '系统设置', '个人设置'
])
expect(adminNavigationItems.every(item => !('permissionCode' in item))).toBe(true)
})
it('builds breadcrumb trails from the same menu hierarchy', () => {
expect(getAdminBreadcrumbTrail('/admin').map(item => item.label)).toEqual(['首页'])
expect(getAdminBreadcrumbTrail('/admin/registrations').map(item => item.label)).toEqual(['首页', '账号管理', '注册审核'])
expect(getAdminBreadcrumbTrail('/admin/orders').map(item => item.label)).toEqual(['首页', '门店管理', '订单管理'])
expect(getAdminBreadcrumbTrail('/admin/settings').map(item => item.label)).toEqual(['首页', '系统设置'])
expect(getAdminBreadcrumbTrail('/admin/unknown')).toEqual([])
})
})
@@ -16,6 +16,10 @@ export interface AdminNavigationItem {
path: string
iconKey: AdminNavIconKey
label: string
/** 面包屑上级路径,复用同一份菜单配置维护层级,避免页面与中文路径的重复映射表。 */
parentPath?: string
/** 不在侧边栏菜单展示,仅用于已注册路由的面包屑层级。 */
menuHidden?: boolean
}
export const ADMIN_HOME_PATH = '/admin'
@@ -24,12 +28,38 @@ export const ADMIN_DASHBOARD_PATH = ADMIN_HOME_PATH
export const adminNavigationItems: AdminNavigationItem[] = [
{ path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页' },
{ path: '/admin/users', iconKey: 'user', label: '账号管理' },
{ path: '/admin/registrations', iconKey: 'team', label: '注册审核' },
{ path: '/admin/privacy', iconKey: 'security', label: '隐私与内容复核' },
{ path: '/admin/registrations', iconKey: 'team', label: '注册审核', parentPath: '/admin/users' },
{ path: '/admin/privacy', iconKey: 'security', label: '隐私与内容复核', parentPath: '/admin/users' },
{ path: '/admin/shops', iconKey: 'home', label: '门店管理' },
{ path: '/admin/orders', iconKey: 'shopping', label: '订单管理', parentPath: '/admin/shops', menuHidden: true },
{ path: '/admin/after-sales', iconKey: 'tool', label: '售后处理', parentPath: '/admin/shops', menuHidden: true },
{ path: '/admin/inventory', iconKey: 'tag', label: '库存管理', parentPath: '/admin/shops', menuHidden: true },
{ path: '/admin/settings', iconKey: 'tool', label: '系统设置' },
{ path: '/admin/profile', iconKey: 'user', label: '个人设置' }
]
export const findAdminNavigationItemByPath = (path: string) =>
adminNavigationItems.find(item => item.path === path)
/**
* 沿 parentPath 回溯生成面包屑链路(首页在前、当前页在后)。
* 未登记的路径返回空数组,由调用方用路由 meta 标题兜底。
*/
export const getAdminBreadcrumbTrail = (path: string): AdminNavigationItem[] => {
const chain: AdminNavigationItem[] = []
const visited = new Set<string>()
let current = findAdminNavigationItemByPath(path)
while (current && !visited.has(current.path)) {
chain.unshift(current)
visited.add(current.path)
current = current.parentPath ? findAdminNavigationItemByPath(current.parentPath) : undefined
}
if (!chain.length) {
return chain
}
if (chain[0]?.path !== ADMIN_HOME_PATH) {
const home = findAdminNavigationItemByPath(ADMIN_HOME_PATH)
if (home) chain.unshift(home)
}
return chain
}
+124 -110
View File
@@ -8,9 +8,14 @@
>
<a-layout>
<a-layout-sider v-if="!isMobile" v-model:collapsed="collapsed" :trigger="null" collapsible class="sider" :width="224" :collapsed-width="74">
<div class="logo">
<span class="logo-mark">S</span>
<strong v-if="!collapsed">Salon</strong>
<div class="sider-head">
<div class="logo">
<span class="logo-mark">S</span>
<strong v-if="!collapsed">Salon</strong>
</div>
<button class="sider-toggle" type="button" :aria-label="collapsed ? '展开导航' : '收起导航'" @click="collapsed = !collapsed">
<MenuUnfoldOutlined v-if="collapsed" /><MenuFoldOutlined v-else />
</button>
</div>
<div v-if="!collapsed" class="sider-section-label">工作台</div>
<a-menu :selectedKeys="selectedKeys" mode="inline" theme="dark" @click="handleMenuClick">
@@ -25,11 +30,13 @@
<a-layout-header class="header">
<div class="header-shell">
<div class="header-left">
<button v-if="!isMobile" class="trigger" type="button" :aria-label="collapsed ? '展开导航' : '收起导航'" @click="collapsed = !collapsed">
<MenuUnfoldOutlined v-if="collapsed" /><MenuFoldOutlined v-else />
</button>
<button v-else class="trigger" type="button" aria-label="打开导航" @click="mobileDrawerOpen = true"><MenuOutlined /></button>
<div class="header-title"><span>Salon 管理后台</span><small>平台经营数据与运营事项</small></div>
<button v-if="isMobile" class="trigger" type="button" aria-label="打开导航" @click="mobileDrawerOpen = true"><MenuOutlined /></button>
<a-breadcrumb class="header-breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadcrumbItems" :key="item.path">
<router-link v-if="index < breadcrumbItems.length - 1" :to="item.path" class="breadcrumb-link">{{ item.label }}</router-link>
<span v-else class="breadcrumb-current">{{ item.label }}</span>
</a-breadcrumb-item>
</a-breadcrumb>
</div>
<a-dropdown>
<button class="user-dropdown" type="button">
@@ -70,41 +77,20 @@
</a-button>
</div>
</a-drawer>
<a-modal
v-model:open="agreementModalOpen"
title="用户协议与隐私政策已更新"
:closable="false"
:maskClosable="false"
:keyboard="false"
:footer="null"
>
<div class="agreement-gate">
<p>新版本{{ agreementVersionText ? `(${agreementVersionText})` : '' }}已发布,请阅读并同意后继续使用后台。</p>
<p class="agreement-gate__links">
<a href="/legal/user-terms.html" target="_blank" rel="noopener">查看用户协议</a>
<span> · </span>
<a href="/legal/privacy-policy.html" target="_blank" rel="noopener">查看隐私政策</a>
</p>
<a-button type="primary" block :loading="agreementAccepting" @click="acceptAgreements">同意并继续</a-button>
</div>
</a-modal>
</div>
</template>
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { message, Modal } from 'ant-design-vue'
import { DownOutlined, HomeOutlined, LogoutOutlined, MenuFoldOutlined, MenuOutlined, MenuUnfoldOutlined, SafetyCertificateOutlined, TeamOutlined, ToolOutlined, UserOutlined } from '@ant-design/icons-vue'
import type { Component } from 'vue'
import { adminNavigationItems, type AdminNavIconKey } from '@/config/admin-navigation'
import { ADMIN_HOME_PATH, adminNavigationItems, findAdminNavigationItemByPath, getAdminBreadcrumbTrail, type AdminNavIconKey, type AdminNavigationItem } from '@/config/admin-navigation'
import { DEFAULT_AVATAR } from '@/constants'
import { completeAdminLogout } from '@/utils/admin-logout'
import { runWithGlobalLoading } from '@/utils/action-loading'
import { useAdminViewport } from '@/composables/useAdminViewport'
import { legalAgreementApi, type AgreementPending } from '@/api/auth'
import { AGREEMENT_REQUIRED_EVENT, setAgreementPending } from '@/utils/agreement-gate'
const router = useRouter()
const route = useRoute()
@@ -113,61 +99,30 @@ const collapsed = ref(false)
const mobileDrawerOpen = ref(false)
const selectedKeys = ref<string[]>([route.path])
const userInfo = ref<any>(null)
const agreementModalOpen = ref(false)
const agreementAccepting = ref(false)
const agreementVersionText = ref('')
const iconMap: Record<AdminNavIconKey, Component> = { home: HomeOutlined, user: UserOutlined, shop: HomeOutlined, security: SafetyCertificateOutlined, tool: ToolOutlined, team: TeamOutlined, dashboard: HomeOutlined, gift: HomeOutlined, message: HomeOutlined, tag: HomeOutlined, shopping: HomeOutlined, calendar: HomeOutlined }
const menuItems = adminNavigationItems.map(item => ({ key: item.path, label: item.label, icon: iconMap[item.iconKey] }))
const menuItems = adminNavigationItems.filter(item => !item.menuHidden).map(item => ({ key: item.path, label: item.label, icon: iconMap[item.iconKey] }))
/**
* 面包屑层级直接来自菜单配置:沿 parentPath 回溯到首页,最后一项为当前页且不可点击。
* 未登记的路由用 meta.title 兜底,避免新增页面时出现空白面包屑。
*/
const breadcrumbItems = computed<AdminNavigationItem[]>(() => {
const trail = getAdminBreadcrumbTrail(route.path)
if (trail.length) return trail
const fallbackTitle = typeof route.meta.title === 'string' ? route.meta.title : ''
if (!fallbackTitle) return []
const home = findAdminNavigationItemByPath(ADMIN_HOME_PATH)
const currentItem: AdminNavigationItem = { path: route.path, iconKey: 'home', label: fallbackTitle, parentPath: ADMIN_HOME_PATH }
return home ? [home, currentItem] : [currentItem]
})
const handleMenuClick = ({ key }: { key: string | number }) => router.push(String(key))
const openMobileMenu = ({ key }: { key: string | number }) => { mobileDrawerOpen.value = false; router.push(String(key)) }
const handleLogout = () => Modal.confirm({ title: '确认退出登录', content: '退出后需要重新登录后台。', okText: '确认', cancelText: '取消', onOk: async () => { await runWithGlobalLoading(() => completeAdminLogout(router)); message.success('已退出登录') } })
const checkAgreementGate = async () => {
try {
const result = await legalAgreementApi.getPending() as unknown as AgreementPending
if (result?.pending) {
agreementVersionText.value = result.currentVersions?.USER_TERMS || ''
setAgreementPending(true)
agreementModalOpen.value = true
} else {
setAgreementPending(false)
}
} catch (error) {
// 查询失败不阻塞后台使用,协议接口仍由服务端登录态校验保护
}
}
const acceptAgreements = async () => {
if (agreementAccepting.value) return
agreementAccepting.value = true
try {
const result = await legalAgreementApi.accept('WEB') as unknown as AgreementPending
if (result?.pending === true) {
throw new Error('协议同意状态未更新,请稍后重试')
}
setAgreementPending(false)
agreementModalOpen.value = false
message.success('已同意最新版协议')
} catch (error: any) {
message.error(error?.message || '同意协议失败')
} finally {
agreementAccepting.value = false
}
}
watch(() => route.path, path => { selectedKeys.value = [path] }, { immediate: true })
/**
* 服务端返回 4510 时由请求层广播该事件,这里复用既有弹层逻辑重新检查协议状态。
*/
const handleAgreementRequired = () => { checkAgreementGate() }
onMounted(() => {
try { userInfo.value = JSON.parse(localStorage.getItem('adminUserInfo') || 'null') } catch { userInfo.value = null }
window.addEventListener(AGREEMENT_REQUIRED_EVENT, handleAgreementRequired)
checkAgreementGate()
})
onBeforeUnmount(() => {
window.removeEventListener(AGREEMENT_REQUIRED_EVENT, handleAgreementRequired)
})
</script>
@@ -205,17 +160,59 @@ onBeforeUnmount(() => {
transition: width 0.22s ease;
}
.sider-head {
display: flex;
align-items: center;
height: 68px;
padding: 0 10px 0 14px;
}
.logo,
.drawer-brand {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
color: #fff;
}
.logo {
flex: 1;
min-width: 0;
padding: 0;
}
.drawer-brand {
height: 68px;
padding: 0 14px;
}
.sider-toggle {
display: grid;
flex: 0 0 30px;
place-items: center;
width: 30px;
height: 30px;
padding: 0;
border: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 9px;
background: rgba(255, 255, 255, 0.08);
color: rgba(255, 255, 255, 0.9);
cursor: pointer;
font-size: 15px;
}
.sider-toggle:hover {
border-color: rgba(255, 255, 255, 0.55);
background: rgba(255, 255, 255, 0.16);
color: #fff;
}
.sider-toggle:focus-visible {
outline: 2px solid rgba(255, 255, 255, 0.85);
outline-offset: 2px;
}
.logo strong,
.drawer-brand__copy strong {
color: #fff;
@@ -299,10 +296,30 @@ onBeforeUnmount(() => {
background: #e5f8f1;
}
.admin-layout--collapsed .sider-head {
padding-inline: 6px;
gap: 4px;
}
.admin-layout--collapsed .logo {
padding-inline: 0;
}
.admin-layout--collapsed .logo-mark {
flex-basis: 30px;
width: 30px;
height: 30px;
border-radius: 10px;
font-size: 18px;
}
.admin-layout--collapsed .sider-toggle {
flex-basis: 28px;
width: 28px;
height: 28px;
font-size: 14px;
}
.admin-layout--collapsed .sider :deep(.ant-menu-item) {
width: 50px;
padding-inline: 0;
@@ -362,20 +379,37 @@ onBeforeUnmount(() => {
outline-offset: 2px;
}
.header-title {
display: grid;
gap: 3px;
.header-breadcrumb {
min-width: 0;
overflow: hidden;
color: #5b746f;
font-size: 13px;
white-space: nowrap;
}
.header-breadcrumb :deep(.ant-breadcrumb) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.header-breadcrumb :deep(.ant-breadcrumb-separator) {
margin-inline: 8px;
color: #9aada8;
}
.breadcrumb-link {
color: #5b746f;
font-weight: 600;
}
.breadcrumb-link:hover {
color: var(--theme-primary-action);
}
.breadcrumb-current {
color: #224d47;
}
.header-title span {
font-size: 15px;
font-weight: 750;
}
.header-title small {
color: #78918b;
font-size: 11px;
font-weight: 700;
}
.user-dropdown {
@@ -485,22 +519,6 @@ onBeforeUnmount(() => {
color: #fff;
}
.agreement-gate {
display: grid;
gap: 14px;
color: #315650;
line-height: 1.7;
}
.agreement-gate p {
margin: 0;
}
.agreement-gate__links a {
color: var(--theme-primary-action);
font-weight: 700;
}
@media (max-width: 960px) {
.header,
.content {
@@ -513,10 +531,6 @@ onBeforeUnmount(() => {
padding: 0 16px;
}
.header-title small {
display: none;
}
.content {
padding: 18px 14px 28px;
}
@@ -1,15 +1,5 @@
<template>
<div class="after-sales">
<a-page-header v-if="!isMobile" title="售后处理" sub-title="处理客户退款与售后申请" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">售后</span>
<h1 class="admin-page-intro__title">售后处理</h1>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">申请 {{ pagination.total }}</span>
</div>
</section>
<a-card :bordered="false">
<template #title v-if="isMobile">售后列表</template>
@@ -1,16 +1,5 @@
<template>
<div class="inventory">
<a-page-header v-if="!isMobile" title="库存管理" sub-title="维护门店耗材库存和预警阈值" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">库存</span>
<h1 class="admin-page-intro__title">库存管理</h1>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">物料 {{ pagination.total }}</span>
<span class="admin-page-chip">预警 {{ warningCount }}</span>
</div>
</section>
<a-card :bordered="false">
<template #title v-if="isMobile">库存列表</template>
<template #extra>
@@ -1,19 +1,5 @@
<template>
<div class="orders">
<a-page-header v-if="!isMobile" title="订单管理" sub-title="管理系统订单" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">订单</span>
<h1 class="admin-page-intro__title">订单工作台</h1>
<p class="admin-page-intro__subtitle">
手机端不再默认展示横向大表格,而是把筛选、状态和处理按钮压到单列卡片里。
</p>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">订单 {{ filteredOrders.length }}</span>
<span class="admin-page-chip">{{ canProcessOrders ? '可处理订单' : '查看模式' }}</span>
</div>
</section>
<a-card :bordered="false">
<template #title v-if="isMobile">
订单列表
@@ -1,13 +1,5 @@
<template>
<div class="privacy-page">
<header class="admin-view-heading">
<div>
<span class="admin-view-heading__eyebrow">账号与内容安全</span>
<h1>隐私与内容复核</h1>
<p>处理账号注销、待审内容与历史手机号加密回填。</p>
</div>
</header>
<a-alert
:type="moderationNotice.type"
show-icon
@@ -1,14 +1,5 @@
<template>
<div class="admin-profile">
<header class="profile-head">
<div>
<span class="profile-eyebrow">管理员账号</span>
<h1>{{ userInfo?.nickname || '平台管理员' }}</h1>
<p>{{ userInfo?.account || '当前登录账号' }}</p>
</div>
<a-avatar :size="58" :src="userInfo?.avatar || DEFAULT_AVATAR" />
</header>
<section class="profile-section">
<div class="profile-section__head">
<div><h2>账号资料</h2><p>该后台只服务平台管理员,数据范围为 Salon 全平台。</p></div>
@@ -58,7 +49,6 @@ import { reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { message, Modal } from 'ant-design-vue'
import type { Rule } from 'ant-design-vue/es/form'
import { DEFAULT_AVATAR } from '@/constants'
import { adminAuthApi } from '@/api/admin'
import { clearAdminBootstrapSession } from '@/utils/admin-auth-bootstrap'
import { completeAdminLogout } from '@/utils/admin-logout'
@@ -122,10 +112,7 @@ const handleLogout = () => Modal.confirm({
<style scoped>
.admin-profile { display: grid; gap: 18px; color: var(--admin-mobile-ink); }
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0 18px; border-bottom: 1px solid var(--admin-mobile-border); }
.profile-eyebrow { color: var(--theme-primary-action); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.profile-head h1 { margin: 7px 0 4px; font-size: 28px; }
.profile-head p, .profile-section__head p { margin: 0; color: var(--admin-mobile-muted); font-size: 13px; }
.profile-section__head p { margin: 0; color: var(--admin-mobile-muted); font-size: 13px; }
.profile-section { padding-top: 4px; border-top: 1px solid var(--admin-mobile-border); }
.profile-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; }
.profile-section__head h2 { margin: 0 0 4px; font-size: 17px; }
@@ -1,12 +1,7 @@
<template>
<main class="salon-dashboard">
<header class="dashboard-head">
<div>
<span class="dashboard-eyebrow">SALON PLATFORM</span>
<h1>Salon 管理后台</h1>
<p>用门店、员工、客户和服务数据掌握平台经营状态。</p>
<div class="dashboard-freshness"><span>系统日期 {{ currentDateLabel }}</span><span>最近刷新 {{ lastRefreshedAt || '尚未刷新' }}</span></div>
</div>
<div class="dashboard-freshness"><span>系统日期 {{ currentDateLabel }}</span><span>最近刷新 {{ lastRefreshedAt || '尚未刷新' }}</span></div>
<div class="dashboard-tools">
<label class="date-control"><span>统计日期</span><input v-model="date" type="date" @change="loadOverview" /></label>
<div class="range-control" role="group" aria-label="趋势范围">
@@ -154,11 +149,8 @@ onMounted(() => { void loadOverview() })
<style scoped>
.salon-dashboard { display: grid; gap: 22px; color: var(--admin-mobile-ink); }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 5px; }
.dashboard-eyebrow { color: var(--theme-primary-action); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.dashboard-head h1 { margin: 7px 0 5px; font-size: 32px; }
.dashboard-head p { margin: 0; color: var(--admin-mobile-muted); font-size: 13px; }
.dashboard-freshness { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--admin-mobile-muted); font-size: 11px; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 5px; }
.dashboard-freshness { display: flex; flex-wrap: wrap; gap: 14px; color: var(--admin-mobile-muted); font-size: 11px; }
.dashboard-tools { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.date-control { display: grid; gap: 5px; color: var(--admin-mobile-muted); font-size: 11px; }
.date-control input { height: 34px; padding: 0 9px; border: 1px solid var(--admin-mobile-border); border-radius: 8px; background: var(--theme-card-bg); color: var(--admin-mobile-ink); font: inherit; }
@@ -209,6 +201,5 @@ onMounted(() => { void loadOverview() })
.asset-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; min-height: 50px; border-bottom: 1px solid var(--admin-mobile-border); }.asset-row span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }.asset-row strong { font-size: 16px; }.asset-row small { width: 46px; color: var(--admin-mobile-muted); font-size: 10px; text-align: right; }.asset-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--theme-primary); }.asset-mark--manager { background: #6f9fd1; }.asset-mark--staff { background: #a887d1; }.asset-mark--customer { background: #d89b64; }.asset-mark--style { background: #78a8a1; }
.empty-state { display: grid; place-items: center; min-height: 160px; color: var(--admin-mobile-muted); font-size: 12px; }.empty-state--inline { min-height: 180px; }.trend-chart--empty { opacity: .8; }
@media (max-width: 1000px) { .dashboard-head { align-items: flex-start; flex-direction: column; }.dashboard-tools { justify-content: flex-start; }.dashboard-grid, .dashboard-grid--lower { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .dashboard-head h1 { font-size: 27px; } }
@media (max-width: 680px) { .dashboard-head h1 { font-size: 27px; }.kpi-strip { grid-template-columns: repeat(2, 1fr); }.kpi-item { min-height: 100px; padding: 15px 13px; }.kpi-item:nth-child(2n) { border-right: 0; }.kpi-item:nth-child(-n+3) { border-bottom: 1px solid var(--admin-mobile-border); }.kpi-item strong { font-size: 24px; }.trend-chart { gap: 3px; }.trend-bar { width: 6px; }.chart-legend { flex-wrap: wrap; }.legend-note { width: 100%; margin-left: 0; }.dashboard-tools { width: 100%; }.date-control { flex: 1; }.date-control input { width: 100%; }.range-control button { padding: 0 8px; } }
@media (max-width: 680px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); }.kpi-item { min-height: 100px; padding: 15px 13px; }.kpi-item:nth-child(2n) { border-right: 0; }.kpi-item:nth-child(-n+3) { border-bottom: 1px solid var(--admin-mobile-border); }.kpi-item strong { font-size: 24px; }.trend-chart { gap: 3px; }.trend-bar { width: 6px; }.chart-legend { flex-wrap: wrap; }.legend-note { width: 100%; margin-left: 0; }.dashboard-tools { width: 100%; }.date-control { flex: 1; }.date-control input { width: 100%; }.range-control button { padding: 0 8px; } }
</style>
@@ -1,18 +1,5 @@
<template>
<div class="shops">
<a-page-header v-if="!isMobile" title="店铺管理" sub-title="管理美甲店铺" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">经营</span>
<h1 class="admin-page-intro__title">店铺管理</h1>
<p class="admin-page-intro__subtitle">
移动端优先展示 Banner、营业时间、地址和启停状态,让店铺信息在手机上也能完整维护。
</p>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">店铺 {{ shopList.length }}</span>
</div>
</section>
<a-card :bordered="false">
<template #title v-if="isMobile">
店铺列表
@@ -1,15 +1,5 @@
<template>
<div class="users">
<a-page-header v-if="!isMobile" title="店长账号" sub-title="管理店长账号及店铺授权" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">经营</span>
<h1 class="admin-page-intro__title">店长账号</h1>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">用户 {{ userList.length }}</span>
</div>
</section>
<a-card :bordered="false">
<template #title v-if="isMobile">
店长账号列表
@@ -1,13 +1,5 @@
<template>
<div class="registration-page">
<header class="admin-view-heading">
<div>
<span class="admin-view-heading__eyebrow">账号管理</span>
<h1>注册审核</h1>
<p>处理店长注册申请;员工加入申请由店长在小程序员工页面审核。</p>
</div>
<div class="admin-view-heading__count"><strong>{{ applications.length }}</strong><span>条申请记录</span></div>
</header>
<div class="registration-table">
<a-table
:columns="columns"