mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-08 16:05:07 +08:00
初始化项目,自 v1.7.1 版本开始
This commit is contained in:
26
src/views/Redirect/Redirect.vue
Normal file
26
src/views/Redirect/Redirect.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script setup lang="ts" name="Redirect">
|
||||
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
|
||||
|
||||
if (_redirect_type === 'name') {
|
||||
replace({
|
||||
name: _path,
|
||||
query,
|
||||
params
|
||||
})
|
||||
} else {
|
||||
replace({
|
||||
path: _path.startsWith('/') ? _path : '/' + _path,
|
||||
query
|
||||
})
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user