This commit is contained in:
2020-01-31 22:54:07 +00:00
parent 3d6263be3d
commit eca2f34ba6
3 changed files with 9 additions and 3 deletions

View File

@@ -36,7 +36,8 @@ export function processLogin(response) {
authenticated: true,
userId: Number(token.id),
userName: token.name,
roles: token["ayanova/roles"]
roles: token["ayanova/roles"],
userType: token["usertype"]
});
//Initialize the application

View File

@@ -694,12 +694,14 @@ export default function initialize() {
window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.CustomerFull,
window.$gz.role.AUTHORIZATION_ROLES.CustomerLimited
])
]) &&
(window.$gz.store.userType == 4 || window.$gz.store.userType == 5)
) {
//clear sublevel array
sub = [];
//Set homePage in store to dashboard
//Set homePage in store to customer csr for this user type
window.$gz.store.commit("setHomePage", "/customer-csr-list");
//CSR LIST subitem

View File

@@ -17,6 +17,7 @@ export default new Vuex.Store({
userId: 0,
userName: "NOT AUTHENTICATED",
roles: 0,
userType: 0,
homePage: undefined,
localeText: {},
locale: {
@@ -40,6 +41,7 @@ export default new Vuex.Store({
state.roles = data.roles;
state.apiToken = data.apiToken;
state.userName = data.userName;
state.userType = data.userType;
},
logout(state) {
//Things that are reset on logout
@@ -48,6 +50,7 @@ export default new Vuex.Store({
state.userId = 0;
state.userName = "NOT AUTHENTICATED";
state.roles = 0;
state.userType = 0;
state.homePage = undefined;
state.navItems = [];
state.localeText = {};