11import { createRouter , createWebHashHistory } from "vue-router" ;
22import DefaultLayout from "../layout/DefaultLayout.vue" ;
3- import LoginPage from "../views/LoginPage.vue" ;
3+ // import LoginPage from "../views/LoginPage.vue";
44import HomePage from "../views/HomePage.vue" ;
55import ModePage from "../views/ModePage.vue" ;
66import ParentPage from "../views/ParentPage.vue" ;
77import LocationPage from "../views/LocationPage.vue" ;
88import TransactionPage from "../views/TransactionPage.vue" ;
99
1010const routes = [
11- { path : "/" , component : LoginPage } ,
11+ // { path: "/", component: LoginPage },
1212 {
1313 path : "/" ,
1414 component : DefaultLayout ,
1515 children : [
16- { path : "mode " , component : ModePage , meta : { requiresAuth : true } } ,
17- { path : "home" , component : HomePage , meta : { requiresAuth : true } } ,
18- { path : "parent" , component : ParentPage , meta : { requiresAuth : true } } ,
19- { path : "location" , component : LocationPage , meta : { requiresAuth : true } } ,
20- { path : "transaction" , component : TransactionPage , meta : { requiresAuth : true } } ,
16+ { path : "" , component : ModePage /* , meta: { requiresAuth: true }*/ } ,
17+ { path : "home" , component : HomePage /* , meta: { requiresAuth: true }*/ } ,
18+ { path : "parent" , component : ParentPage /* , meta: { requiresAuth: true }*/ } ,
19+ { path : "location" , component : LocationPage /* , meta: { requiresAuth: true }*/ } ,
20+ { path : "transaction" , component : TransactionPage /* , meta: { requiresAuth: true }*/ } ,
2121 ] ,
2222 } ,
2323] ;
@@ -27,14 +27,14 @@ const router = createRouter({
2727 routes
2828} ) ;
2929
30- router . beforeEach ( ( to , from , next ) => {
31- const isAuthenticated = localStorage . getItem ( 'isAuthenticated' ) ;
32-
33- if ( to . meta . requiresAuth && ! isAuthenticated ) {
34- next ( '/' ) ;
35- } else {
36- next ( ) ;
37- }
38- } ) ;
30+ // router.beforeEach((to, from, next) => {
31+ // const isAuthenticated = localStorage.getItem('isAuthenticated');
32+ //
33+ // if (to.meta.requiresAuth && !isAuthenticated) {
34+ // next('/');
35+ // } else {
36+ // next();
37+ // }
38+ // });
3939
4040export default router ;
0 commit comments