Преглед на файлове

关闭页签后存在其他页签时不应该跳转首页

RuoYi преди 3 години
родител
ревизия
feff419641
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      ruoyi-ui/src/plugins/tab.js

+ 6 - 2
ruoyi-ui/src/plugins/tab.js

@@ -32,8 +32,12 @@ export default {
32 32
   // 关闭指定tab页签
33 33
   closePage(obj) {
34 34
     if (obj === undefined) {
35
-      return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => {
36
-        return router.push(lastPath || '/');
35
+      return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
36
+        const latestView = visitedViews.slice(-1)[0]
37
+        if (latestView) {
38
+            return router.push(latestView.fullPath)
39
+        }
40
+        return router.push('/');
37 41
       });
38 42
     }
39 43
     return store.dispatch('tagsView/delView', obj);