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, authenticated: true,
userId: Number(token.id), userId: Number(token.id),
userName: token.name, userName: token.name,
roles: token["ayanova/roles"] roles: token["ayanova/roles"],
userType: token["usertype"]
}); });
//Initialize the application //Initialize the application

View File

@@ -694,12 +694,14 @@ export default function initialize() {
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.CustomerFull, window.$gz.role.AUTHORIZATION_ROLES.CustomerFull,
window.$gz.role.AUTHORIZATION_ROLES.CustomerLimited window.$gz.role.AUTHORIZATION_ROLES.CustomerLimited
]) ]) &&
(window.$gz.store.userType == 4 || window.$gz.store.userType == 5)
) { ) {
//clear sublevel array //clear sublevel array
sub = []; 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"); window.$gz.store.commit("setHomePage", "/customer-csr-list");
//CSR LIST subitem //CSR LIST subitem

View File

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