From 00f7ab34efc17bf383eecf7bf81844b874ac1a8d Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期二, 03 十二月 2024 11:15:09 +0800
Subject: [PATCH] fix 修复 修复默认关闭Tags-Views时,内链页面打不开

---
 src/permission.ts |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/permission.ts b/src/permission.ts
index 69795f8..51a928a 100644
--- a/src/permission.ts
+++ b/src/permission.ts
@@ -40,8 +40,7 @@
               router.addRoute(route); // 鍔ㄦ�佹坊鍔犲彲璁块棶璺敱琛�
             }
           });
-          const n = { ...to, replace: true };
-          console.log(n);
+          // @ts-expect-error hack鏂规硶 纭繚addRoutes宸插畬鎴�
           next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack鏂规硶 纭繚addRoutes宸插畬鎴�
         }
       } else {
@@ -54,7 +53,8 @@
       // 鍦ㄥ厤鐧诲綍鐧藉悕鍗曪紝鐩存帴杩涘叆
       next();
     } else {
-      next(`/login?redirect=${to.fullPath}`); // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤�
+      const redirect = encodeURIComponent(to.fullPath || '/');
+      next(`/login?redirect=${redirect}`); // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤�
       NProgress.done();
     }
   }

--
Gitblit v1.9.3