Explorar el Código

修复重启后断后页面白屏问题

pixel hace 3 años
padre
commit
a11af03252
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      web/src/permission.js

+ 1 - 3
web/src/permission.js

@@ -24,9 +24,7 @@ router.beforeEach(async (to, from, next) => {
                 asyncRouterFlag++
                 await store.dispatch('router/SetAsyncRouter')
                 const asyncRouters = store.getters['router/asyncRouters']
-                asyncRouters.forEach(item => {
-                    router.addRoute(item)
-                })
+                router.addRoutes(asyncRouters)
                 next({ ...to, replace: true })
             } else {
                 if (to.matched.length) {