mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-19 05:25:07 +08:00
refactor: vue3 axios api ...
This commit is contained in:
@ -94,13 +94,13 @@ export const generateRoutes = (routes: AppCustomRouteRecordRaw[]): AppRouteRecor
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const getRedirect = (parentPath: string, children: Array<Object>) => {
|
||||
export const getRedirect = (parentPath: string, children: AppCustomRouteRecordRaw[]) => {
|
||||
if (!children || children.length == 0) {
|
||||
return parentPath
|
||||
}
|
||||
const path = generateRoutePath(parentPath, children[0]?.path)
|
||||
const path = generateRoutePath(parentPath, children[0].path)
|
||||
// 递归子节点
|
||||
return getRedirect(path, children[0]?.children)
|
||||
if (children[0].children) return getRedirect(path, children[0].children)
|
||||
}
|
||||
const generateRoutePath = (parentPath: string, path: string) => {
|
||||
if (parentPath.endsWith('/')) {
|
||||
|
Reference in New Issue
Block a user