|
@@ -15,6 +15,7 @@ router.beforeEach((to, from, next) => {
|
|
} else {
|
|
} else {
|
|
if (store.getters.roles.length === 0) {
|
|
if (store.getters.roles.length === 0) {
|
|
store.dispatch('GetInfo').then(res => { // 拉取用户信息
|
|
store.dispatch('GetInfo').then(res => { // 拉取用户信息
|
|
|
|
+
|
|
let menus=res.data.menus;
|
|
let menus=res.data.menus;
|
|
let username=res.data.username;
|
|
let username=res.data.username;
|
|
store.dispatch('GenerateRoutes', { menus,username }).then(() => { // 生成可访问的路由表
|
|
store.dispatch('GenerateRoutes', { menus,username }).then(() => { // 生成可访问的路由表
|
|
@@ -22,6 +23,7 @@ router.beforeEach((to, from, next) => {
|
|
next({ ...to, replace: true })
|
|
next({ ...to, replace: true })
|
|
})
|
|
})
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
|
+ return
|
|
store.dispatch('FedLogOut').then(() => {
|
|
store.dispatch('FedLogOut').then(() => {
|
|
Message.error(err || 'Verification failed, please login again')
|
|
Message.error(err || 'Verification failed, please login again')
|
|
next({ path: '/' })
|
|
next({ path: '/' })
|