mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02: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);
|
||||
|
@ -112,17 +112,19 @@ const routes : RouterOptions = {
|
||||
{
|
||||
path: "/privacy-policy",
|
||||
name: "privacy-policy",
|
||||
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/datenschutzerklaerung/",
|
||||
component: {},
|
||||
meta: {
|
||||
label: "privacy"
|
||||
label: "privacy",
|
||||
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/datenschutzerklaerung/",
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/imprint",
|
||||
name: "imprint",
|
||||
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/impressum/",
|
||||
component: {},
|
||||
meta: {
|
||||
label: "imprint"
|
||||
label: "imprint",
|
||||
redirect: "https://www.htwk-leipzig.de/hochschule/kontakt/impressum/",
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user