mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 05:28:13 +00:00
fix: auth redirect
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ export default defineComponent({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
if (store.authState != AuthState.AUTHORIZED && to.path != '/login') return next({ path: '/login' });
|
if (store.authState == AuthState.AUTHORIZED && to.path == '/login') return next({ path: '/' });
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user