Browse Source

refine code

Pan 7 years ago
parent
commit
7efffb9f47
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/main.js

+ 2 - 4
src/main.js

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