import { Router } from "vue-router"
import { TOKEN_KEY } from "../utils/enum/token";
import { BaseRouteRouter } from "./index"
const whiteRoutes = ["/login", "/sso"]

export default (router: Router) => {
    router.beforeEach((to, from, next) => {
        // const token = localStorage.getItem(TOKEN_KEY)
        // if (whiteRoutes.includes(to.path)) {
        //     return next()
        // }

        // if (!token) {
        //     router.replace(BaseRouteRouter.LOGIN);
        // } else {
        //     next()
        // }
        next()
    })
    return router
}