Commit e582b960 authored by 张伯涛's avatar 张伯涛

角色修改

parent 0dea105d
......@@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => {
store.dispatch('GetInfo').then(res => {
// 判断用户是否有权限 有角色
if (res.data.roles && res.data.roles.length > 0 && res.data.permissions && res.data.permissions.length > 0) {
if (res.data.permissions && res.data.permissions.length > 0) {
// 拉取user_info
// const roles = res.data.roles
store.dispatch('GenerateRoutes', res).then((routers) => {
......@@ -36,7 +36,7 @@ router.beforeEach((to, from, next) => {
router.addRoutes(routers.accessedRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
} else {
alert('用户无权限')
alert('用户无权限1')
store.dispatch('FedLogOut').then(() => {
next({ path: '/' })
// window.location.href = `${process.env.VUE_APP_LOGIN}?redirect=${to.fullPath}&reLocation=${process.env.VUE_APP_NQ}`
......@@ -44,7 +44,7 @@ router.beforeEach((to, from, next) => {
}
})
} else {
alert('用户无权限')
alert('用户无权限2')
store.dispatch('FedLogOut').then(() => {
next({ path: '/' })
// window.location.href = `${process.env.VUE_APP_LOGIN}?redirect=${to.fullPath}&reLocation=${process.env.VUE_APP_NQ}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment