#
zhou zhou
3 天以前 4259deb19122a4807d50c99ed4a95405ebe4a47c
rsf-design/src/router/guards/afterEach.js
@@ -3,10 +3,10 @@
import NProgress from 'nprogress'
import { useCommon } from '@/hooks/core/useCommon'
import { loadingService } from '@/utils/ui'
import { getPendingLoading, resetPendingLoading } from './beforeEach'
import { getPendingLoading, resetPendingLoading, triggerHomeRouteWarmup } from './beforeEach'
function setupAfterEachGuard(router) {
  const { scrollToTop } = useCommon()
  router.afterEach(() => {
  const { scrollToTop, homePath } = useCommon()
  router.afterEach((to) => {
    scrollToTop()
    const settingStore = useSettingStore()
    if (settingStore.showNprogress) {
@@ -21,6 +21,9 @@
        resetPendingLoading()
      })
    }
    nextTick(() => {
      triggerHomeRouteWarmup(to.path, homePath.value || '/')
    })
  })
}
export { setupAfterEachGuard }