<template>
  <div></div>
</template>

<script setup>
import { onBeforeMount } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const route = useRoute()
const router = useRouter()

onBeforeMount(() => {
  const { params, query } = route
  const { path } = params
  
  // 将path数组转换为路径字符串
  const redirectPath = Array.isArray(path) ? '/' + path.join('/') : '/' + path
  
  router.replace({ path: redirectPath, query })
})
</script> 