You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
463 B
17 lines
463 B
export default defineNuxtPlugin((nuxtApp) => {
|
|
const router = useRouter()
|
|
const route = useRoute()
|
|
|
|
// Empêcher la redirection vers la racine
|
|
router.beforeEach((to, from, next) => {
|
|
const basePath = '/containers/matheothierry-portfolio_nuxt'
|
|
|
|
// Si l'URL ne commence pas par le bon chemin, rediriger vers le bon chemin
|
|
if (!to.fullPath.startsWith(basePath)) {
|
|
next(basePath + to.fullPath)
|
|
return
|
|
}
|
|
|
|
next()
|
|
})
|
|
})
|