Skip to content

Commit 6508b1c

Browse files
committed
refine
1 parent 523a9b3 commit 6508b1c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ router.beforeEach((to, from, next) => {
4747
if (to.path === '/login') {
4848
next({ path: '/' });
4949
} else {
50-
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完info信息
51-
store.dispatch('GetInfo').then(res => { // 拉取info
50+
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
51+
store.dispatch('GetInfo').then(res => { // 拉取user_info
5252
const roles = res.data.role;
5353
store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
5454
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表

src/store/modules/permission.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const permission = {
2222
},
2323

2424
actions: {
25-
// s
2625
GenerateRoutes({ commit }, data) {
2726
return new Promise(resolve => {
2827
const { roles } = data;

0 commit comments

Comments
 (0)