Skip to content

Commit

Permalink
fix: 修复标签页刷新后404问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ktianc committed Oct 7, 2023
1 parent bbcfb1c commit 95a6ee9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
17 changes: 17 additions & 0 deletions kinit-admin/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ export const constantRouterMap: AppRouteRecordRaw[] = [
}
]
},
{
path: '/redirect',
component: Layout,
name: 'Redirect',
children: [
{
path: '/redirect/:path(.*)',
name: 'Redirect',
component: () => import('@/views/Redirect/Redirect.vue'),
meta: {}
}
],
meta: {
hidden: true,
noTagsView: true
}
},
{
path: '/login',
component: () => import('@/views/Login/Login.vue'),
Expand Down
30 changes: 30 additions & 0 deletions kinit-admin/src/views/Redirect/Redirect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div></div>
</template>
<script setup lang="ts">
import { unref } from 'vue'
import { useRouter } from 'vue-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
if (_redirect_type === 'name') {
replace({
name: _path,
query,
params
})
} else {
replace({
path: _path.startsWith('/') ? _path : '/' + _path,
query
})
}
</script>
2 changes: 1 addition & 1 deletion kinit-api/application/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""
系统版本
"""
VERSION = "3.0.0"
VERSION = "3.0.1"

"""安全警告: 不要在生产中打开调试运行!"""
DEBUG = False
Expand Down

0 comments on commit 95a6ee9

Please sign in to comment.