fix: 全面修复项目问题
后端修复: - 验证码存储与校验机制 - 订单创建事务+库存扣减 - GetStats字段名错误 - VerifyEmail改为POST - 供应商更新字段白名单 - 文件删除安全检查 - 抽奖安全随机数 - 用户管理CRUD - 订单取消/确认收货 - 工单回复 - Toggle返回新数据 - 移除死代码 前端修复: - 404兜底路由 - 401软跳转 - API层统一 - 面包屑补充banners - 国际化完善 - 购物车并行删除 - 退出清理购物车 - 供应商Dashboard数据 - 工单详情页 - 订单取消/确认收货
This commit is contained in:
@@ -47,7 +47,11 @@
|
||||
</router-link>
|
||||
<router-link to="/admin/articles" class="nav-link">
|
||||
<el-icon><Document /></el-icon>
|
||||
<span class="nav-text">资讯管理</span>
|
||||
<span class="nav-text">{{ $t('admin.articleManagement') }}</span>
|
||||
</router-link>
|
||||
<router-link to="/admin/banners" class="nav-link">
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span class="nav-text">{{ $t('admin.bannerManagement') }}</span>
|
||||
</router-link>
|
||||
<router-link to="/admin/settings" class="nav-link">
|
||||
<el-icon><Setting /></el-icon>
|
||||
@@ -95,7 +99,45 @@
|
||||
<button class="menu-btn" @click="mobileMenuOpen = !mobileMenuOpen">
|
||||
<el-icon><Expand /></el-icon>
|
||||
</button>
|
||||
<h1 class="page-title">{{ currentPageTitle }}</h1>
|
||||
<nav class="breadcrumb">
|
||||
<span class="breadcrumb-item" @click="$router.push('/admin')">
|
||||
<el-icon><HomeFilled /></el-icon>
|
||||
<span>首页</span>
|
||||
</span>
|
||||
<el-icon class="breadcrumb-sep"><ArrowRight /></el-icon>
|
||||
<span class="breadcrumb-current">{{ currentPageTitle }}</span>
|
||||
</nav>
|
||||
<div class="topbar-actions">
|
||||
<el-tooltip content="返回前台" placement="bottom">
|
||||
<button class="action-btn" @click="router.push('/')">
|
||||
<el-icon><HomeFilled /></el-icon>
|
||||
</button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="全屏" placement="bottom">
|
||||
<button class="action-btn" @click="toggleFullscreen">
|
||||
<el-icon><FullScreen /></el-icon>
|
||||
</button>
|
||||
</el-tooltip>
|
||||
<el-dropdown trigger="click" @command="handleCommand" placement="bottom-end">
|
||||
<div class="user-dropdown">
|
||||
<el-avatar :size="32" class="user-avatar">{{ user?.username?.charAt(0).toUpperCase() }}</el-avatar>
|
||||
<span class="user-name">{{ user?.username }}</span>
|
||||
<el-icon class="dropdown-arrow"><ArrowDown /></el-icon>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="home">
|
||||
<el-icon><HomeFilled /></el-icon>
|
||||
返回前台
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
退出登录
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</header>
|
||||
<main class="page-content">
|
||||
<router-view />
|
||||
@@ -110,13 +152,15 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { DataAnalysis, User, Folder, Goods, List, Van, Trophy, ChatDotSquare, Setting, Document, Compass, Fold, Expand } from '@element-plus/icons-vue'
|
||||
import { DataAnalysis, User, Folder, Goods, List, Van, Trophy, ChatDotSquare, Setting, Document, Picture, Compass, Fold, Expand, HomeFilled, FullScreen, ArrowDown, SwitchButton, ArrowRight } from '@element-plus/icons-vue'
|
||||
import { useUserStore } from '../store/user'
|
||||
import { useCartStore } from '../store/cart'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { locale, t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const cartStore = useCartStore()
|
||||
const sidebarCollapsed = ref(false)
|
||||
const mobileMenuOpen = ref(false)
|
||||
|
||||
@@ -132,6 +176,7 @@ const pageTitles: Record<string, string> = {
|
||||
'/admin/lotteries': '抽奖管理',
|
||||
'/admin/tickets': '工单管理',
|
||||
'/admin/articles': '资讯管理',
|
||||
'/admin/banners': '轮播图管理',
|
||||
'/admin/settings': '系统设置'
|
||||
}
|
||||
|
||||
@@ -147,7 +192,15 @@ function changeLocale(lang: string) {
|
||||
function handleCommand(command: string) {
|
||||
switch (command) {
|
||||
case 'home': router.push('/'); break
|
||||
case 'logout': userStore.logout(); router.push('/login'); break
|
||||
case 'logout': userStore.logout(); cartStore.clearCart(); router.push('/login'); break
|
||||
}
|
||||
}
|
||||
|
||||
function toggleFullscreen() {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement.requestFullscreen()
|
||||
} else {
|
||||
document.exitFullscreen()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -328,11 +381,99 @@ function handleCommand(command: string) {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.breadcrumb-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.breadcrumb-item:hover {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.breadcrumb-sep {
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.breadcrumb-current {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
padding: 4px 8px;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.topbar-actions {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.action-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.user-dropdown {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.user-dropdown:hover {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
background: linear-gradient(135deg, #4e6ef2, #7c5cfc);
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dropdown-arrow {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
@@ -364,10 +505,30 @@ function handleCommand(command: string) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.menu-btn {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.breadcrumb-item span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dropdown-arrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.user-dropdown {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.collapse-btn {
|
||||
display: none;
|
||||
}
|
||||
@@ -379,5 +540,9 @@ function handleCommand(command: string) {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 16px 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user