From b5400ed02a22aaa8643aed3b0419585bb70c1970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Wed, 6 Dec 2023 11:55:57 +0800 Subject: [PATCH] chore: fix type (#653) * chore: fix type * chore: remove console --- src/locales/index.ts | 2 -- src/utils/route/index.ts | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/locales/index.ts b/src/locales/index.ts index 19ae7ca..33ba482 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -18,14 +18,12 @@ const languages = usePreferredLanguages(); // 生成语言模块列表 const generateLangModuleMap = () => { const fullPaths = Object.keys(langModules); - console.log(langModules, 'langModules'); fullPaths.forEach((fullPath) => { const k = fullPath.replace('./lang', ''); const startIndex = 1; const lastIndex = k.lastIndexOf('/'); const code = k.substring(startIndex, lastIndex); langCode.push(code); - console.log(langCode, 'langCode'); langModuleMap.set(code, langModules[fullPath]); }); }; diff --git a/src/utils/route/index.ts b/src/utils/route/index.ts index fedb846..d00a030 100644 --- a/src/utils/route/index.ts +++ b/src/utils/route/index.ts @@ -51,7 +51,8 @@ function asyncImportRoute(routes: RouteItem[] | undefined) { } else if (name) { item.component = PARENT_LAYOUT(); } - if (item.meta.icon) item.meta.icon = (await getMenuIcon(item.meta.icon)).value; + + if (item.meta.icon) item.meta.icon = await getMenuIcon(item.meta.icon); // eslint-disable-next-line no-unused-expressions children && asyncImportRoute(children); @@ -102,7 +103,7 @@ export function transformObjectToRoute(routeList: RouteItem[]): T } // eslint-disable-next-line no-unused-expressions route.children && asyncImportRoute(route.children); - if (route.meta.icon) route.meta.icon = (await getMenuIcon(route.meta.icon)).value; + if (route.meta.icon) route.meta.icon = await getMenuIcon(route.meta.icon); }); return [PAGE_NOT_FOUND_ROUTE, ...routeList] as unknown as T[];