mirror of
https://github.com/rustfs/console.git
synced 2026-09-19 01:47:44 +08:00
18 lines
302 B
TypeScript
18 lines
302 B
TypeScript
|
|
|
|
export default defineNuxtRouteMiddleware((to, from) => {
|
|
const isAuthenticated = useAuth().isAuthenticated.value
|
|
|
|
if (to.path === '/auth/login') {
|
|
if (isAuthenticated) {
|
|
return navigateTo('/')
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
if (!isAuthenticated) {
|
|
return navigateTo('/auth/login')
|
|
}
|
|
})
|