gzuioidjkclq
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
cd01c00d61
commit
83dc3fff96
@ -1,11 +0,0 @@
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
const basePath = '/containers/matheothierry-portfolio_nuxt'
|
||||
|
||||
// Si nous sommes déjà sur le bon chemin, ne rien faire
|
||||
if (to.fullPath.startsWith(basePath)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Sinon, rediriger vers le bon chemin
|
||||
return navigateTo(basePath + to.fullPath, { redirectCode: 301 })
|
||||
})
|
@ -1,17 +1,17 @@
|
||||
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
|
||||
export default defineNuxtPlugin({
|
||||
name: 'router',
|
||||
enforce: 'pre',
|
||||
setup(nuxtApp) {
|
||||
nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
|
||||
console.error('Vue Error:', error)
|
||||
console.error('Component:', instance)
|
||||
console.error('Info:', info)
|
||||
}
|
||||
|
||||
next()
|
||||
})
|
||||
nuxtApp.hook('vue:error', (error, instance, info) => {
|
||||
console.error('Vue Error:', error)
|
||||
console.error('Component:', instance)
|
||||
console.error('Info:', info)
|
||||
})
|
||||
}
|
||||
})
|
Loading…
Reference in new issue