From e6c26fcb4ae085f9fd7d7eb9183ddba020d0b5da Mon Sep 17 00:00:00 2001 From: Soybean Date: Mon, 14 Mar 2022 15:16:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=AE=88=E5=8D=AB=E7=9A=84=E5=8A=A8=E6=80=81=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 +++ src/router/guard/dynamic.ts | 11 ++++++----- src/store/subscribe/theme.ts | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/components.d.ts b/components.d.ts index e0b6694e9..0e4819a0e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -16,6 +16,9 @@ declare module 'vue' { IconCustomAvatar: typeof import('~icons/custom/avatar')['default'] IconCustomLogo: typeof import('~icons/custom/logo')['default'] IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default'] + IconCustomNoPermission: typeof import('~icons/custom/no-permission')['default'] + IconCustomNotFound: typeof import('~icons/custom/not-found')['default'] + IconCustomServiceError: typeof import('~icons/custom/service-error')['default'] IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default'] IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default'] IconIcOutlineCheck: typeof import('~icons/ic/outline-check')['default'] diff --git a/src/router/guard/dynamic.ts b/src/router/guard/dynamic.ts index 5ac73c6c2..eb8a69acd 100644 --- a/src/router/guard/dynamic.ts +++ b/src/router/guard/dynamic.ts @@ -35,11 +35,12 @@ export async function createDynamicRouteGuard( next({ path: to.fullPath, replace: true, query: to.query }); return false; } - // 动态路由已经加载,仍然未找到,重定向到not-found - if (to.name === routeName('not-found-page')) { - next({ name: routeName('not-found'), replace: true }); - return false; - } + } + + // 动态路由已经加载,仍然未找到,重定向到not-found + if (to.name === routeName('not-found-page')) { + next({ name: routeName('not-found'), replace: true }); + return false; } return true; diff --git a/src/store/subscribe/theme.ts b/src/store/subscribe/theme.ts index 88ac78b1c..23fb7e591 100644 --- a/src/store/subscribe/theme.ts +++ b/src/store/subscribe/theme.ts @@ -28,6 +28,9 @@ export default function subscribeThemeStore() { } else { removeDarkClass(); } + }, + { + immediate: true, } );