import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import HomeView from '../views/home/index.vue'

const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHistory('/app2'),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    }
  ]
})
router.beforeEach((to, from, next) => {
  console.log(to,';aaaaaaaaaaaaaaa');
  
  if (to.fullPath === '/undefined') {
    next('/');
  } else {
    next();
  }
})
export default router
