From ddbf9504fc5faf6764fffa4e9263a3ad927331d8 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期一, 14 七月 2025 17:14:26 +0800 Subject: [PATCH] '-' --- src/router/index.ts | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 40689c3..a4d8e99 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -106,7 +106,9 @@ } /** 璺敱鐧藉悕鍗� */ -const whiteList = []; +const whiteList = ["/login"]; +const noLoginList = ["/index", "/register", "/registersucess"]; +// const whiteList = []; const { VITE_HIDE_HOME } = import.meta.env; @@ -140,7 +142,7 @@ } // 寮�鍚殣钘忛椤靛悗鍦ㄦ祻瑙堝櫒鍦板潃鏍忔墜鍔ㄨ緭鍏ラ椤祑elcome璺敱鍒欒烦杞埌404椤甸潰 if (VITE_HIDE_HOME === "true" && to.fullPath === "/welcome") { - next({ path: "/error/404" }); + next({ path: "/index" }); } if (_from?.name) { // name涓鸿秴閾炬帴 @@ -193,10 +195,15 @@ } else { if (to.path !== "/login") { if (whiteList.indexOf(to.path) !== -1) { + console.log(to.path, "====1", noLoginList.indexOf(to.path)); next(); } else { - removeToken(); - next({ path: "/login" }); + // if (noLoginList.indexOf(to.path) == -1) { + next(); + // } else { + // removeToken(); + // next({ path: "/login" }); + // } } } else { next(); -- Gitblit v1.9.1