This commit is contained in:
@@ -55,7 +55,7 @@ function handleError(action, error, route, reject) {
|
||||
"notify-warning",
|
||||
window.$gz.locale.get("ErrorUserNotAuthorized")
|
||||
);
|
||||
router.push("/home-dashboard");
|
||||
router.push(window.$gz.store.state.homePage);
|
||||
return reject("[ErrorUserNotAuthorized]");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@ export default function initialize() {
|
||||
key: key++
|
||||
});
|
||||
|
||||
//Set homePage in store to dashboard
|
||||
window.$gz.store.commit("setHomePage", "/home-dashboard");
|
||||
|
||||
//SEARCH
|
||||
if (
|
||||
window.$gz.role.hasRole([
|
||||
@@ -609,6 +612,12 @@ export default function initialize() {
|
||||
key: key++
|
||||
});
|
||||
|
||||
//Set home page if they don't already have the dashboard set above
|
||||
if (!window.$gz.store.state.homePage) {
|
||||
//Set homePage in store to Backup
|
||||
window.$gz.store.commit("setHomePage", "/ops-BACKUP");
|
||||
}
|
||||
|
||||
// JOBS
|
||||
sub.push({
|
||||
title: window.$gz.locale.get("ServerJobs"),
|
||||
|
||||
@@ -17,6 +17,7 @@ export default new Vuex.Store({
|
||||
userId: 0,
|
||||
userName: "NOT AUTHENTICATED",
|
||||
roles: 0,
|
||||
homePage: undefined,
|
||||
localeText: {},
|
||||
locale: {
|
||||
decimalSeparator: ".",
|
||||
@@ -47,6 +48,7 @@ export default new Vuex.Store({
|
||||
state.userId = 0;
|
||||
state.userName = "NOT AUTHENTICATED";
|
||||
state.roles = 0;
|
||||
state.homePage = undefined;
|
||||
state.navItems = [];
|
||||
state.localeText = {};
|
||||
state.formCustomTemplate = {};
|
||||
@@ -102,6 +104,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
clearFormSettings(state, formKey) {
|
||||
delete state.formSettings[formKey];
|
||||
},
|
||||
setHomePage(state, data) {
|
||||
state.homePage = data;
|
||||
}
|
||||
},
|
||||
actions: {}
|
||||
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
auth
|
||||
.authenticate(this.input.username, this.input.password)
|
||||
.then(() => {
|
||||
vm.$router.push("/home-dashboard");
|
||||
vm.$router.push(vm.$store.state.homePage);
|
||||
})
|
||||
.catch(function handleCaughtLoginError(error) {
|
||||
/* xeslint-disable-next-line */
|
||||
|
||||
Reference in New Issue
Block a user