update 优化 去掉多余的参数

This commit is contained in:
疯狂的狮子Li 2023-10-25 23:05:32 +08:00
parent cd0a459c2b
commit ec0cb472df

View File

@ -88,7 +88,7 @@ const initFuse = (list: Router) => {
} }
// Filter out the routes that can be displayed in the sidebar // Filter out the routes that can be displayed in the sidebar
// And generate the internationalized title // And generate the internationalized title
const generateRoutes = (routes: RouteOption[], basePath = '', prefixTitle: string[] = [], query: any = {}) => { const generateRoutes = (routes: RouteOption[], basePath = '', prefixTitle: string[] = []) => {
let res: Router = [] let res: Router = []
routes.forEach(r => { routes.forEach(r => {
// skip hidden router // skip hidden router
@ -114,7 +114,7 @@ const generateRoutes = (routes: RouteOption[], basePath = '', prefixTitle: strin
// recursive child routes // recursive child routes
if (r.children) { if (r.children) {
const tempRoutes = generateRoutes(r.children, data.path, data.title, data.query); const tempRoutes = generateRoutes(r.children, data.path, data.title);
if (tempRoutes.length >= 1) { if (tempRoutes.length >= 1) {
res = [...res, ...tempRoutes]; res = [...res, ...tempRoutes];
} }