|
@@ -17,7 +17,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
|
|
|
|
|
// determine whether the user has logged in
|
|
// determine whether the user has logged in
|
|
|
const hasToken = getToken()
|
|
const hasToken = getToken()
|
|
|
-
|
|
|
|
|
|
|
+ debugger
|
|
|
if (hasToken) {
|
|
if (hasToken) {
|
|
|
if (to.path === '/login') {
|
|
if (to.path === '/login') {
|
|
|
// if is logged in, redirect to the home page
|
|
// if is logged in, redirect to the home page
|
|
@@ -34,7 +34,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
} else {
|
|
} else {
|
|
|
try {
|
|
try {
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
- store.dispatch('user/getInfo')
|
|
|
|
|
|
|
+ // store.dispatch('user/getInfo')
|
|
|
// // 根据角色生成可访问的路线图
|
|
// // 根据角色生成可访问的路线图
|
|
|
next({ ...to, replace: true })
|
|
next({ ...to, replace: true })
|
|
|
} catch (error) {
|
|
} catch (error) {
|