This commit is contained in:
@@ -324,14 +324,34 @@ export default {
|
|||||||
//this smells bad but it works
|
//this smells bad but it works
|
||||||
vm.$root.$gz = window.$gz;
|
vm.$root.$gz = window.$gz;
|
||||||
|
|
||||||
|
//direct open path?
|
||||||
|
let toPath = window.location.pathname;
|
||||||
|
|
||||||
|
if (toPath != undefined && toPath.length > 4 && !toPath.includes("login")) {
|
||||||
|
//must be at least 4 to be a valid AyaNova url
|
||||||
|
window.$gz.store.commit(
|
||||||
|
"logItem",
|
||||||
|
`App::Mounted - preset path presented: ${toPath}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
toPath = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
//redirect to login if not authenticated
|
//redirect to login if not authenticated
|
||||||
if (!vm.$store.state.authenticated) {
|
if (!vm.$store.state.authenticated) {
|
||||||
//If a direct open path was being used but user is not logged in this will catch it
|
//If a direct open path was being used but user is not logged in this will catch it
|
||||||
//otherwise they will just go on to that path directly
|
//otherwise they will just go on to that path directly
|
||||||
vm.$router.push({
|
|
||||||
name: "login",
|
if (toPath != undefined) {
|
||||||
params: { topath: window.location.pathname }
|
vm.$router.push({
|
||||||
});
|
name: "login",
|
||||||
|
params: { topath: window.location.pathname }
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
vm.$router.push({
|
||||||
|
name: "login"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//RELOAD / REFRESH HANDLING
|
//RELOAD / REFRESH HANDLING
|
||||||
//Restart notification polling due to refresh?
|
//Restart notification polling due to refresh?
|
||||||
|
|||||||
@@ -307,7 +307,8 @@ export default {
|
|||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.$route.params.topath != undefined) {
|
let toPath = vm.$route.params.topath; //set in app.vue::mounted
|
||||||
|
if (toPath != undefined) {
|
||||||
vm.$router.push(vm.$route.params.topath);
|
vm.$router.push(vm.$route.params.topath);
|
||||||
} else {
|
} else {
|
||||||
vm.$router.push(vm.$store.state.homePage);
|
vm.$router.push(vm.$store.state.homePage);
|
||||||
|
|||||||
Reference in New Issue
Block a user