From eaf14dd28b5c95a08d433c6b6ccb5d2c0de2a2d4 Mon Sep 17 00:00:00 2001
From: weicd <weicd@yhzhg.cn>
Date: Thu, 04 Jan 2024 01:51:15 +0000
Subject: [PATCH] 首页跳转日报
---
eladmin-web-master/src/router/index.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/eladmin-web-master/src/router/index.js b/eladmin-web-master/src/router/index.js
index 47be649..247d83f 100644
--- a/eladmin-web-master/src/router/index.js
+++ b/eladmin-web-master/src/router/index.js
@@ -15,6 +15,7 @@
if (to.meta.title) {
document.title = to.meta.title + ' - ' + Config.title
}
+ console.log('to.path : ', to.path)
NProgress.start()
if (getToken()) {
// 已登录且要跳转的页面是登录页
@@ -23,6 +24,7 @@
NProgress.done()
} else {
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
+ console.log('1111111111111111111111111111111111111111111111111')
store.dispatch('GetInfo').then(() => { // 拉取user_info
// 动态路由,拉取菜单
loadMenus(next, to)
@@ -33,10 +35,12 @@
})
// 登录时未拉取 菜单,在此处拉取
} else if (store.getters.loadMenus) {
+ console.log('222222222222222222222222222222222222222222222222222')
// 修改成false,防止死循环
store.dispatch('updateLoadMenus')
loadMenus(next, to)
} else {
+ console.log('33333333333333333333333333333333333333333333333333')
next()
}
}
@@ -52,6 +56,7 @@
})
export const loadMenus = (next, to) => {
+ console.log('44444444444444444444444444444444444444444444')
buildMenus().then(res => {
const sdata = JSON.parse(JSON.stringify(res))
const rdata = JSON.parse(JSON.stringify(res))
@@ -61,6 +66,7 @@
store.dispatch('GenerateRoutes', rewriteRoutes).then(() => { // 存储路由
router.addRoutes(rewriteRoutes) // 动态添加可访问路由表
+ console.log('to.path2 : ', to.path)
next({ ...to, replace: true })
})
store.dispatch('SetSidebarRouters', sidebarRoutes)
--
Gitblit v1.9.3