redirect.vue 403 B

123456789101112131415161718192021222324
  1. <script setup lang="ts">
  2. import { unref } from "vue";
  3. import { useRouter } from "vue-router";
  4. defineOptions({
  5. name: "Redirect"
  6. });
  7. const { currentRoute, replace } = useRouter();
  8. const { params, query } = unref(currentRoute);
  9. const { path } = params;
  10. const _path = Array.isArray(path) ? path.join("/") : path;
  11. replace({
  12. path: "/" + _path,
  13. query
  14. });
  15. </script>
  16. <template>
  17. <div />
  18. </template>