router.guards.js 268 B

123456789101112131415161718
  1. export function createRouterGuards(router, systemStore) {
  2. router.beforeEach(async (to, from, next) => {
  3. next()
  4. })
  5. router.afterEach((to, _, next) => {
  6. })
  7. // 错误
  8. router.onError(error => {
  9. console.log(error, '路由错误')
  10. })
  11. }