From 03c275439949875a857538df89a41696642c42b3 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 01 九月 2025 17:15:39 +0800
Subject: [PATCH] '首页公告与详情'

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

diff --git a/src/router/index.ts b/src/router/index.ts
index 40689c3..2513d48 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -106,7 +106,15 @@
 }
 
 /** 璺敱鐧藉悕鍗� */
-const whiteList = [];
+const whiteList = ["/login"];
+const noLoginList = [
+  "/index",
+  "/register",
+  "/registernav",
+  "/registersucess",
+  "/gonggaoDetail"
+];
+// const whiteList = [];
 
 const { VITE_HIDE_HOME } = import.meta.env;
 
@@ -126,7 +134,7 @@
       if (!item.meta.title) return "";
       const Title = getConfig().Title;
       if (Title) document.title = `${item.meta.title} | ${Title}`;
-      else document.title = item.meta.title as string;
+      else document.title = item.meta.title;
     });
   }
   /** 濡傛灉宸茬粡鐧诲綍骞跺瓨鍦ㄧ櫥褰曚俊鎭悗涓嶈兘璺宠浆鍒拌矾鐢辩櫧鍚嶅崟锛岃�屾槸缁х画淇濇寔鍦ㄥ綋鍓嶉〉闈� */
@@ -140,7 +148,7 @@
     }
     // 寮�鍚殣钘忛椤靛悗鍦ㄦ祻瑙堝櫒鍦板潃鏍忔墜鍔ㄨ緭鍏ラ椤祑elcome璺敱鍒欒烦杞埌404椤甸潰
     if (VITE_HIDE_HOME === "true" && to.fullPath === "/welcome") {
-      next({ path: "/error/404" });
+      next({ path: "/index" });
     }
     if (_from?.name) {
       // name涓鸿秴閾炬帴
@@ -192,11 +200,11 @@
     }
   } else {
     if (to.path !== "/login") {
-      if (whiteList.indexOf(to.path) !== -1) {
+      if (noLoginList.indexOf(to.path) !== -1) {
         next();
       } else {
         removeToken();
-        next({ path: "/login" });
+        next({ path: "/index" });
       }
     } else {
       next();

--
Gitblit v1.9.1