Q-ABAB 2 years ago
parent
commit
41bd27833f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/App.vue

+ 5 - 1
src/App.vue

@@ -35,13 +35,17 @@ export default {
       }).catch(err=>{
       }).catch(err=>{
         console.log(err)
         console.log(err)
       })
       })
+    },
+    CleanStorage(){
+      sessionStorage.clear()
     }
     }
   },
   },
   mounted(){
   mounted(){
     this.userLogin();
     this.userLogin();
+    window.addEventListener('beforeunload', this.CleanStorage());
   },
   },
   beforeDestroy(){
   beforeDestroy(){
-    sessionStorage.clear()
+    window.removeEventListener('beforeunload', this.CleanStorage());
   }
   }
 };
 };
 </script>
 </script>