import Vue from "vue";
import VueRouter from "vue-router";
import HomePage from "@/pages/HomePage.vue";
import PortfolioPage from "@/pages/PortfolioPage.vue";
import SampleCollectionPage from "@/pages/SampleCollectionPage.vue";
import PortfolioMan from "@/pages/man/PortfolioManPage.vue";
import SampleCollectionMan from "@/pages/man/SampleCollectionManPage.vue";
import HomeManPage from "@/pages/man/HomeManPage.vue";
import TagManPage from "@/pages/man/TagManPage.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "HomePage",
    component: HomePage,
  },
  {
    path: "/portfolio",
    name: "PortfolioPage",
    component: PortfolioPage,
  },
  {
    path: "/sampleCollection",
    name: "SampleCollectionPage",
    component: SampleCollectionPage,
  },
  {
    path: "/yumi",
    name: "Yumi",
    component: HomeManPage,
  },
  {
    path: "/sampleCollectionman",
    name: "SampleCollectionMan",
    component: SampleCollectionMan,
  },
  {
    path: "/portfolioMan",
    name: "PortfolioMan",
    component: PortfolioMan,
  },
  {
    path: "/tagManPage",
    name: "tagManPage",
    component: TagManPage,
  }
];

const router = new VueRouter({
  mode: "history",
  routes,
});

// 全局前置守卫
router.beforeEach((to, from, next) => {
  next();
});

export default router;
