在app.vue的页面中添加以下代码
//此方法刷新页面时也会执行 window.addEventListener('beforeunload',()=>{ this.$store.commit("setToken", ""); });