refine code

This commit is contained in:
Pan 2017-07-03 14:40:33 +08:00
parent 2e13d61107
commit 7efffb9f47
1 changed files with 2 additions and 4 deletions

View File

@ -28,11 +28,9 @@ router.beforeEach((to, from, next) => {
const roles = res.data.role;
store.dispatch('GenerateRoutes', { roles }).then(() => {
router.addRoutes(store.getters.addRouters)
next(to.path);
next(Object.assign({}, to));
})
}).catch(err => {
console.log(err);
});
})
} else {
next();
}