123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <div></div>
- </template>
- <script lang="ts" setup>
- import { unref, onMounted } from 'vue';
- import { useRouter } from 'vue-router';
- import { router } from '/@/router';
- const { currentRoute, replace, } = useRouter();
- const { params, query } = unref(currentRoute);
- const { path, _redirect_type = 'path' } = params;
- Reflect.deleteProperty(params, '_redirect_type');
- Reflect.deleteProperty(params, 'path');
- const _path = Array.isArray(path) ? path.join('/') : path;
-
- onMounted(() => {
- if(query && query['redirect']) router.push({path: query['redirect']})
- // if (_redirect_type === 'name') {
- // // replace({
- // // name: _path,
- // // query,
- // // params,
- // // });
- // router.push({
- // name: _path,
- // query,
- // params
- // })
- // } else {
- // // replace({
- // // path: _path.startsWith('/') ? _path : '/' + _path,
- // // query,
- // // });
- // router.push({
- // path: _path.startsWith('/') ? _path : '/' + _path,
- // query,
- // })
- // }
- })
- </script>
|