From 540168985df4896b176c5836ce32659d307af3df Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 4 Jul 2017 16:11:53 +0800 Subject: [PATCH] refine code --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 622efb45..4104e1f2 100644 --- a/src/main.js +++ b/src/main.js @@ -53,7 +53,7 @@ router.beforeEach((to, from, next) => { const roles = res.data.role; store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表 router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表 - next(Object.assign({}, to)); // hack方法 确保addRoutes已完成 + next({ ...to }); // hack方法 确保addRoutes已完成 }) }) } else {