|
|
|
@ -68,7 +68,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
|
// remove token and go to login page to re-login
|
|
|
|
// remove token and go to login page to re-login
|
|
|
|
await store.dispatch('user/resetToken')
|
|
|
|
await store.dispatch('user/resetToken')
|
|
|
|
Message.error(error || 'Has Error')
|
|
|
|
Message.error(error || 'Has Error')
|
|
|
|
next(`/login?redirect=${to.path}`)
|
|
|
|
next(`/login?redirect=${to.fullPath}`)
|
|
|
|
NProgress.done()
|
|
|
|
NProgress.done()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -91,6 +91,17 @@ router.beforeEach(async(to, from, next) => {
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
next('/login')
|
|
|
|
next('/login')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(to.query.auth_token && to.query.oaType==='contractSign' && to.query.contractId){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await store.dispatch('user/loginskip', {
|
|
|
|
|
|
|
|
token: to.query.auth_token,
|
|
|
|
|
|
|
|
tp: 'inner'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
next(to.fullPath?to.fullPath.slice(1): '/')
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.log("e",e)
|
|
|
|
|
|
|
|
next('/login')
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// other pages that do not have permission to access are redirected to the login page.
|
|
|
|
// other pages that do not have permission to access are redirected to the login page.
|
|
|
|
next(`/login?redirect=${to.path}`)
|
|
|
|
next(`/login?redirect=${to.path}`)
|
|
|
|
|