Commit 7efffb9f authored by Pan's avatar Pan

refine code

parent 2e13d611
...@@ -28,11 +28,9 @@ router.beforeEach((to, from, next) => { ...@@ -28,11 +28,9 @@ router.beforeEach((to, from, next) => {
const roles = res.data.role; const roles = res.data.role;
store.dispatch('GenerateRoutes', { roles }).then(() => { store.dispatch('GenerateRoutes', { roles }).then(() => {
router.addRoutes(store.getters.addRouters) router.addRoutes(store.getters.addRouters)
next(to.path); next(Object.assign({}, to));
})
}) })
}).catch(err => {
console.log(err);
});
} else { } else {
next(); next();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment