mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 21:17:30 +00:00
feat: 实现账户分组管理功能和优化响应式设计
主要更新: - 实现账户分组管理功能,支持创建、编辑、删除分组 - 支持将账户添加到分组进行统一调度 - 优化 API Keys 页面响应式设计,解决操作栏被隐藏的问题 - 优化账户管理页面布局,合并平台/类型列,改进操作按钮布局 - 修复代理信息显示溢出问题 - 改进表格列宽分配,充分利用屏幕空间 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,19 @@ const ApiStatsView = () => import('@/views/ApiStatsView.vue')
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/api-stats'
|
||||
redirect: () => {
|
||||
// 智能重定向:避免循环
|
||||
const currentPath = window.location.pathname
|
||||
const basePath = APP_CONFIG.basePath.replace(/\/$/, '') // 移除末尾斜杠
|
||||
|
||||
// 如果当前路径已经是 basePath 或 basePath/,重定向到 api-stats
|
||||
if (currentPath === basePath || currentPath === basePath + '/') {
|
||||
return '/api-stats'
|
||||
}
|
||||
|
||||
// 否则保持默认重定向
|
||||
return '/api-stats'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
@@ -88,6 +100,11 @@ const routes = [
|
||||
component: SettingsView
|
||||
}
|
||||
]
|
||||
},
|
||||
// 捕获所有未匹配的路由
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/api-stats'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -103,10 +120,16 @@ router.beforeEach((to, from, next) => {
|
||||
console.log('路由导航:', {
|
||||
to: to.path,
|
||||
from: from.path,
|
||||
fullPath: to.fullPath,
|
||||
requiresAuth: to.meta.requiresAuth,
|
||||
isAuthenticated: authStore.isAuthenticated
|
||||
})
|
||||
|
||||
// 防止重定向循环:如果已经在目标路径,直接放行
|
||||
if (to.path === from.path && to.fullPath === from.fullPath) {
|
||||
return next()
|
||||
}
|
||||
|
||||
// API Stats 页面不需要认证,直接放行
|
||||
if (to.path === '/api-stats' || to.path.startsWith('/api-stats')) {
|
||||
next()
|
||||
|
||||
Reference in New Issue
Block a user