From 869f6c069e86c2ff90393c1441854a6f05989481 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 15 七月 2022 10:42:46 +0800
Subject: [PATCH] 1.连接自动打印,2.修改bug

---
 src/store/modules/user.js |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 3f0f241..7f65049 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -90,7 +90,7 @@
   },
 
   // user logout
-  logout({ commit, state }) {
+  logout({ commit, state, dispatch }) {
     return new Promise((resolve, reject) => {
       const usercode = getCookie('navTabId')
       const username = getCookie('admin')
@@ -112,10 +112,15 @@
           removeCookie('navTabId')
           removeCookie('usertype')
           removeCookie('userid')
-        }
-        commit('RESET_STATE')
 
-        resolve()
+          // reset visited views and cached views
+          dispatch('tagsView/delAllViews', null, { root: true })
+          sessionStorage.removeItem('tabViews')
+
+          commit('RESET_STATE')
+
+          resolve()
+        }
       }).catch(error => {
         reject(error)
       })

--
Gitblit v1.9.3