index.vue 906 B

1234567891011121314151617181920212223242526272829303132
  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. import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
  9. export default defineComponent({
  10. name: 'Redirect',
  11. setup() {
  12. const { currentRoute, replace } = useRouter();
  13. const { getOpenPageLoading, getEnableTransition } = useTransitionSetting();
  14. const { params, query } = unref(currentRoute);
  15. const { path } = params;
  16. const _path = Array.isArray(path) ? path.join('/') : path;
  17. replace({
  18. path: '/' + _path,
  19. query,
  20. });
  21. if (unref(getEnableTransition) && unref(getOpenPageLoading)) {
  22. setTimeout(() => {
  23. appStore.setPageLoadingAction(false);
  24. }, 0);
  25. }
  26. return {};
  27. },
  28. });
  29. </script>