提交 6508b1cc 编写于 作者: P Pan

refine

上级 523a9b3d
......@@ -47,8 +47,8 @@ router.beforeEach((to, from, next) => {
if (to.path === '/login') {
next({ path: '/' });
} else {
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完info信息
store.dispatch('GetInfo').then(res => { // 拉取info
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(res => { // 拉取user_info
const roles = res.data.role;
store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
......
......@@ -22,7 +22,6 @@ const permission = {
},
actions: {
// s
GenerateRoutes({ commit }, data) {
return new Promise(resolve => {
const { roles } = data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册