feat: 系统功能更新 - 添加错误统计、数据初始化、订单调度等功能

This commit is contained in:
AIGC Developer
2025-12-20 15:24:58 +08:00
parent 0933031b59
commit 5344148a1c
70 changed files with 3649 additions and 688 deletions

View File

@@ -190,6 +190,12 @@ const routes = [
component: () => import('@/views/ApiManagement.vue'),
meta: { title: 'API管理', requiresAuth: true, requiresAdmin: true }
},
{
path: '/admin/error-statistics',
name: 'ErrorStatistics',
component: () => import('@/views/ErrorStatistics.vue'),
meta: { title: '错误统计', requiresAuth: true, requiresAdmin: true }
},
{
path: '/hello',
name: 'HelloWorld',
@@ -246,6 +252,13 @@ router.beforeEach(async (to, from, next) => {
try {
const userStore = useUserStore()
// 检查localStorage中的token是否被清除例如JWT过期后被request.js清除
// 如果token被清除但store中仍有用户信息则同步清除store
const storedToken = localStorage.getItem('token')
if (!storedToken && userStore.isAuthenticated) {
userStore.clearUserData()
}
// 优化:只在首次访问时初始化用户状态
if (!userStore.initialized) {
await userStore.init()