From dade6a8b4772abc113383246d05ab59162630e7c Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期三, 27 八月 2025 17:21:21 +0800 Subject: [PATCH] '上传变更公告获取详情与删除' --- src/router/index.ts | 17 ++++++----------- 1 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 353db8c..5b3f172 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -107,7 +107,7 @@ /** 璺敱鐧藉悕鍗� */ const whiteList = ["/login"]; -const noLoginList = ["/index", "/register", "/registersucess"]; +const noLoginList = ["/index", "/register", "/registernav", "/registersucess"]; // const whiteList = []; const { VITE_HIDE_HOME } = import.meta.env; @@ -128,7 +128,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; }); } /** 濡傛灉宸茬粡鐧诲綍骞跺瓨鍦ㄧ櫥褰曚俊鎭悗涓嶈兘璺宠浆鍒拌矾鐢辩櫧鍚嶅崟锛岃�屾槸缁х画淇濇寔鍦ㄥ綋鍓嶉〉闈� */ @@ -137,7 +137,7 @@ } if (Cookies.get(multipleTabsKey) && userInfo) { // 鏃犳潈闄愯烦杞�403椤甸潰 - if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.exRoles)) { + if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) { next({ path: "/error/403" }); } // 寮�鍚殣钘忛椤靛悗鍦ㄦ祻瑙堝櫒鍦板潃鏍忔墜鍔ㄨ緭鍏ラ椤祑elcome璺敱鍒欒烦杞埌404椤甸潰 @@ -194,16 +194,11 @@ } } else { if (to.path !== "/login") { - if (whiteList.indexOf(to.path) !== -1) { - console.log(to.path, "====1", noLoginList.indexOf(to.path)); + if (noLoginList.indexOf(to.path) !== -1) { next(); } else { - // if (noLoginList.indexOf(to.path) == -1) { - next(); - // } else { - // removeToken(); - // next({ path: "/login" }); - // } + removeToken(); + next({ path: "/index" }); } } else { next(); -- Gitblit v1.9.1