From 1ab85621230b52b01b726fdbc417d0e6419ce9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Fri, 15 Dec 2023 16:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B7=AF=E7=94=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cool/router/index.ts | 6 +++--- src/modules/base/pages/main/components/process.vue | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cool/router/index.ts b/src/cool/router/index.ts index ae49e83..0a1b527 100644 --- a/src/cool/router/index.ts +++ b/src/cool/router/index.ts @@ -18,7 +18,8 @@ const routes: RouteRecordRaw[] = [ children: [] }, { - path: "/:pathMatch(.*)*", + path: "/:catchAll(.*)", + name: "404", component: () => import("/$/base/pages/error/404.vue") } ]; @@ -174,9 +175,8 @@ router.beforeEach(async (to, from, next) => { if (!route?.components) { next(user.token ? "/404" : "/login"); } else { - // 注册后重定向 if (!isReg) { - next({ ...to, ...route }); + next(to.fullPath); } else { // 登录成功 if (user.token) { diff --git a/src/modules/base/pages/main/components/process.vue b/src/modules/base/pages/main/components/process.vue index 988da0e..ca62900 100644 --- a/src/modules/base/pages/main/components/process.vue +++ b/src/modules/base/pages/main/components/process.vue @@ -1,7 +1,7 @@