From 4745b682956116fa09d812c59b485395f45c2e87 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期五, 10 二月 2023 15:38:39 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.20.39:8989/r/LFWEB_NEW

---
 src/App.vue |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 1f9c81a..cb0be87 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -18,6 +18,24 @@
   },
   created() {
   },
+  mounted () {
+    window.addEventListener('beforeunload', e => {
+      sessionStorage.setItem('beforeunload', 1);
+    });
+    // 鐩戝惉椤甸潰鍒锋柊
+    if (sessionStorage.getItem('beforeunload') == 1) {
+      let name = sessionStorage.getItem("routerName");
+      if (name) {
+        this.$nextTick(function () {
+          this.$router.push({ path: name }); //濡傛灉sessionStorage瀛樺湪璺敱锛屽幓缂撳瓨鐨勮矾鐢�
+        })
+      } else {
+        this.$nextTick(function () {
+         this.$router.push({ path: '/' });  //涓嶅瓨鍦ㄥ瓨鍌紝鍘讳富椤�
+        })
+      }
+    }
+  },
   beforeDestroy() { },
 };
 </script>

--
Gitblit v1.9.3