From 6a7124bf9c5207862c15ff735c986aebab614123 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 4 Jul 2017 16:13:02 +0800 Subject: [PATCH] refine code --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index cf37fe6..6e0eace 100644 --- a/src/main.js +++ b/src/main.js @@ -27,8 +27,8 @@ router.beforeEach((to, from, next) => { store.dispatch('GetInfo').then(res => { const roles = res.data.role; store.dispatch('GenerateRoutes', { roles }).then(() => { - router.addRoutes(store.getters.addRouters) - next(Object.assign({}, to)); + router.addRoutes(store.getters.addRouters); + next({ ...to }); }) }) } else {