From f3bdd89a44eb7c60c61c59b61e56452f44037344 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Fri, 27 Sep 2024 16:58:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=20=E4=BF=AE=E6=94=B9getRout?= =?UTF-8?q?erAsync=E8=B7=AF=E7=94=B1=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/v1/routes.ts | 2 +- src/router/utils.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/v1/routes.ts b/src/api/v1/routes.ts index 9fa1396..4b86897 100644 --- a/src/api/v1/routes.ts +++ b/src/api/v1/routes.ts @@ -1,6 +1,6 @@ import { http } from '@/api/service'; import type { BaseResult } from '@/types/BaseResult'; -export const getAsyncRoutes = () => { +export const getRouterAsync = () => { return http.request>('get', 'router/getRouterAsync'); }; diff --git a/src/router/utils.ts b/src/router/utils.ts index 4da423c..f476b48 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -10,7 +10,7 @@ import { type menuType, routerArrays } from '@/layout/types'; import { useMultiTagsStoreHook } from '@/store/multiTags'; import { usePermissionStoreHook } from '@/store/permission'; // 动态路由 -import { getAsyncRoutes } from '@/api/v1/routes'; +import { getRouterAsync } from '@/api/v1/routes'; // import { getAsyncRoutes } from '@/api/routes'; const IFrame = () => import('@/layout/frame.vue'); @@ -153,7 +153,7 @@ function initRouter() { }); } else { return new Promise(resolve => { - getAsyncRoutes().then(({ data }) => { + getRouterAsync().then(({ data }) => { handleAsyncRoutes(cloneDeep(data)); storageLocal().setItem(key, data); resolve(router); @@ -162,7 +162,7 @@ function initRouter() { } } else { return new Promise(resolve => { - getAsyncRoutes().then(({ data }) => { + getRouterAsync().then(({ data }) => { handleAsyncRoutes(cloneDeep(data)); resolve(router); });