mirror of
https://github.com/rustfs/console.git
synced 2026-09-19 01:47:44 +08:00
- Added comprehensive TypeScript type definitions for app configuration - Fixed type safety issues in sidebar component with proper type casting - Improved code organization with better file naming conventions - Enhanced error handling with centralized error management - Added performance optimizations with caching and code splitting - Improved development experience with better tooling configuration - Updated project documentation with comprehensive README - Added proper type definitions for navigation items and app config - Fixed licensing information and added proper Apache 2.0 license 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
19 lines
401 B
TypeScript
19 lines
401 B
TypeScript
|
|
|
|
export default defineNuxtRouteMiddleware((to, from) => {
|
|
const isAuthenticated = useAuth().isAuthenticated.value
|
|
|
|
// 允许访问登录页面和配置页面
|
|
if (to.path === '/auth/login' || to.path === '/config') {
|
|
if (isAuthenticated && to.path === '/auth/login') {
|
|
return navigateTo('/')
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
if (!isAuthenticated) {
|
|
return navigateTo('/auth/login')
|
|
}
|
|
})
|