|
@@ -35,6 +35,8 @@ router.beforeEach((to, from, next) => {
|
|
|
next({ path: GlobalConstant.PC_INDEX_PATH })
|
|
|
NProgress.done()
|
|
|
} else {
|
|
|
+ console.log('to.path=================' + to.path)
|
|
|
+ console.log('to.path=================2' + store.getters.roles.length)
|
|
|
if (store.getters.roles.length === 0) {
|
|
|
store
|
|
|
.dispatch('GetInfo')
|
|
@@ -48,6 +50,7 @@ router.beforeEach((to, from, next) => {
|
|
|
let newPath = null
|
|
|
if (to.path === '/toWorkplaceBacklog') {
|
|
|
const role = res.data.roles.join()
|
|
|
+ console.log('to.path=================3' + role)
|
|
|
switch (true) {
|
|
|
case role.includes('repair'):
|
|
|
newPath = '/NewWorkplaceBacklog'
|
|
@@ -55,6 +58,9 @@ router.beforeEach((to, from, next) => {
|
|
|
case role.includes('store'):
|
|
|
newPath = '/StoreWorkplaceBacklog'
|
|
|
break
|
|
|
+ default :
|
|
|
+ newPath = '/WorkplaceBacklog'
|
|
|
+ break
|
|
|
}
|
|
|
} else {
|
|
|
newPath = to.path
|