mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 12:02:26 +01:00
feat:#45 fix wrong use of redirect
This commit is contained in:
@@ -74,6 +74,16 @@ export const createApp = ViteSSG(
|
||||
router = ctx.router;
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
if (import.meta.env.SSR) {
|
||||
return;
|
||||
}
|
||||
|
||||
// External redirect
|
||||
if (to.matched.some((record) => record.meta.redirect)) {
|
||||
window.location.replace(to.meta.redirect as string);
|
||||
return;
|
||||
}
|
||||
|
||||
const newLocale = to.params.locale;
|
||||
const prevLocale = from.params.locale;
|
||||
// If the locale hasn't changed, do nothing
|
||||
@@ -93,8 +103,6 @@ export const createApp = ViteSSG(
|
||||
},
|
||||
});
|
||||
|
||||
//app.config.globalProperties.$hostname = "https://cal.htwk-leipzig.de"
|
||||
|
||||
app.use(router);
|
||||
app.use(ToastService);
|
||||
app.use(DialogService);
|
||||
|
||||
Reference in New Issue
Block a user