From 7b6078a178b2bc72d2e0f182919ce0267d4ca5fc Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期三, 28 六月 2023 14:28:45 +0800
Subject: [PATCH] !15 适配登录重构的修改 Merge pull request !15 from MichelleChung/ts

---
 src/plugins/tab.ts |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/tab.ts b/src/plugins/tab.ts
index bc4128c..a310154 100644
--- a/src/plugins/tab.ts
+++ b/src/plugins/tab.ts
@@ -33,8 +33,12 @@
   async closePage(obj?: TagView): Promise<{ visitedViews: TagView[]; cachedViews: string[] } | any> {
     if (obj === undefined) {
       // prettier-ignore
-      const { lastPath } = await useTagsViewStore().delView(router.currentRoute.value) as any
-      return router.push(lastPath || '/index');
+      const { visitedViews } = await useTagsViewStore().delView(router.currentRoute.value) as any
+      const latestView = visitedViews.slice(-1)[0]
+      if (latestView) {
+        return router.push(latestView.fullPath)
+      }
+      return router.push('/');
     }
     return useTagsViewStore().delView(obj);
   },

--
Gitblit v1.9.3