From 7a8f1cb7741436c43fc5859707da5041d6648953 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 21 七月 2025 17:21:41 +0800
Subject: [PATCH] -

---
 src/router/index.ts |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/router/index.ts b/src/router/index.ts
index 91e06ca..353db8c 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -106,8 +106,9 @@
 }
 
 /** 璺敱鐧藉悕鍗� */
-// const whiteList = ["/login"];
-const whiteList = [];
+const whiteList = ["/login"];
+const noLoginList = ["/index", "/register", "/registersucess"];
+// const whiteList = [];
 
 const { VITE_HIDE_HOME } = import.meta.env;
 
@@ -136,12 +137,12 @@
   }
   if (Cookies.get(multipleTabsKey) && userInfo) {
     // 鏃犳潈闄愯烦杞�403椤甸潰
-    if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
+    if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.exRoles)) {
       next({ path: "/error/403" });
     }
     // 寮�鍚殣钘忛椤靛悗鍦ㄦ祻瑙堝櫒鍦板潃鏍忔墜鍔ㄨ緭鍏ラ椤祑elcome璺敱鍒欒烦杞埌404椤甸潰
     if (VITE_HIDE_HOME === "true" && to.fullPath === "/welcome") {
-      next({ path: "/error/404" });
+      next({ path: "/index" });
     }
     if (_from?.name) {
       // name涓鸿秴閾炬帴
@@ -194,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