index.vue 810 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div />
  3. </template>
  4. <script lang="ts">
  5. import { defineComponent, unref } from 'vue';
  6. import { appStore } from '/@/store/modules/app';
  7. import { useRouter } from 'vue-router';
  8. export default defineComponent({
  9. name: 'Redirect',
  10. setup() {
  11. const { currentRoute, replace } = useRouter();
  12. const { params, query } = unref(currentRoute);
  13. const { path } = params;
  14. const _path = Array.isArray(path) ? path.join('/') : path;
  15. replace({
  16. path: '/' + _path,
  17. query,
  18. });
  19. const { openRouterTransition, openPageLoading } = appStore.getProjectConfig;
  20. if (openRouterTransition && openPageLoading) {
  21. setTimeout(() => {
  22. appStore.setPageLoadingAction(false);
  23. }, 0);
  24. }
  25. return {};
  26. },
  27. });
  28. </script>