Browse Source

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

main
pixel 4 years ago
parent
commit
a11af03252
  1. 4
      web/src/permission.js

4
web/src/permission.js

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

Loading…
Cancel
Save